Tuesday, December 31, 2019

Solution Force Close When Save Image in UIActivityViewController Swift 5 iOS 13

Hello guys, It's last week for this year. And it feels so fast for me. I have started to be more consistent on this year. I started to post once every week, it's not hard for people have much time. But for me to think about what's next article need more time. I have to have a problem to make a solution haha. Tommorow will be on first day of 2020 year. It's nice to know 2019. And good bye 2019 haha.

So now the problem I faced when I was trying to save image through UIActivityViewController. After saving image the current view controller will dismiss. And it's a bug from iOS, it's confirmed on the internet stackoverflow that I give link on below. Many people faced it before me haha, thanks I know it late so that I don't need to figure it be myself haha. I hope this bug will soon be fixed by Apple. How can this bug didn't happened on iOS 12 but happed on iOS 13. I think it's because iOS 13 introduced new feature modal presentation.

We need to avoid dismissing view controller. Fortunetly I found good solution on the internet, we need to create transparant view controller and it looks clean when the current view will be dismissed. And we need to set transparant in storyboard like screenshoot above. It's simple to do, right ? then follow coding below. It's very important to understand this code to avoid error in the future.

I set background color to Clear Color. So that it will look transparant behind UIActivityViewController. And as if there's no ViewController behind it. So basically it looks same with or without Transparant view controller.

This is the code that I got :

Monday, December 23, 2019

Missing system image Android Studio solution

Happy holidays guys, this is december with long weekend haha. I still have a problem with Android Studio. After I update my emulator and suddenly I got a issue that is so weird. You can see picture above I need to redownload emulator from android studio.

If you got a issue like me, don't worry and don't uninstall your android studio. It's not complicated to resolve it. You just need to redownload the emulator go to Tools -> AVD Manager. You can see the issue of your emulator and redownload or resolve it. And you will be like image above.

Just wait the download and your emulator will be fine again. If you still have the issue, please comment below and let me know what's the problem. I'm happy if i can help you guys. I'm not expert but it's fun when i can solve programming issues.

Wednesday, December 18, 2019

How to have ConstraintLayout inside ScrollView and ScrollView inside ConstraintLayout Android

Hai guys, last week I found a unique way to create layout Android look. You can see the title, that's actually what I want. I know it sounds weird but sometimes we need to create something that we might curious if it's in o n the internet or not.

Why I'm using ConstraintLayout because it's almost same with iOS xcode. There is constraint where you can set top constraint, bottom constraint, left constraint and right constraint. So it's easy for me to design like what I want. But it's personal, it depends on you too.

And fortunely you can combine ScrollView and ConstraintLayout. Because you need to worry when the height of your layout is high than real device height. And if you don't use UIScrollview your component will be unseen when the height of device is more small than layout that we design.

Like my app, I want to use ConstraintLayout and ScrollView together. Maybe it can do with RelativeLayout or others layout. But something special that I want is still using the ConstraintLayout. Because this is the layout that i like. It can be customized through Android Studio without we have to code by our own.

Tuesday, December 10, 2019

How to add back arrow in AppCompatActivity Android

Hello guys, welcome back it's monday today but I'm not gonna post this day maybe tommorow. Today I don't give article about iOS but Android. Because Android has many users so it's not bad to learn it. Basically it's same logic but just different how to implement the layout and components. Android is using java but you can use kotlin but this article I just show Java code. Because I'm too lazy to convert it hehe.

In this article I wanna talk about activity and navigation when you want to go back previous activity and you need to do it through toolbar. I have found easy way to implement it. It's a few codes line, no need to import icon and libraries.

It's included in Android Studio library. I have tried it like screenshoot above and it works when you extend AppCompatActivity. It will automatically give you a back arrow icon in action bar. No more code needed. It's awesome right, android make it simple.

I haven't tried to override the back button method. But you can try to look it on the internet. It supposed to be ok. 

Tuesday, December 3, 2019

Better Using setNavigationBarHidden than zPosition to hide navigation bar

Hello all, This is my first post in December. It's good we reach final month of the year. And I haven't forgot to post article again every week. I'm stil consistent though. This day I'm talking about navigation in iOS. It's very important to have navigation in iOS because every apple apps using navigation too.

Sometimes we need to customize our navigation as we want. And we need to do our own. Because apple doesn't have full feature to edit like UIView did. So we need to create UIView and make it like navigation.

It's ok to use UIView than navigation because it looks same and doesn't have bad impact for our app. And you can custome as you want and it will make your app different from other in good way. Remember too you can avoid using navigation with present and not include navigation controller.

But the advantage to use navigation you have feature swipe to back to previous controller. And it has a animation left to right or right to left. Although you can create custom for your own but it's better to use iOS apple default.

So for any futher you can try and error what's best for you.