In this post we want to discuss, how to divide activity screen (android) by percentage properly. Before we get started, if you want to know about how to programmatically change default font in android studio, please go through the following article: How to use custom font in Android Studio.

I can’t use RelativeLayout if I want to use relative size in Android Studio. Instead, use LinearLayout and android:layout_weight to adjust the percentage. I should use LinearLayout with android:weightSum and android:layout_weight.

Code for divide activity by percentage horizontally

 

Code for divide activity by percentage vertically

You may like How to install Kali Linux on your Android device.

Properly divide activity screen as percentage

Leave a Comment