In this post I'm gonna show you guys a demo of percent layout of android from support library. Since many a time in our awesome RelativeLayout we insert LinearLayout just to get the property of layout_weight for accessing. Now android has a new support library to remove this dependencies. Refer Before beginning some pre-requestic (at the time for development): Android SDK v22 Android Build Tools v22.0.1 Android Percent Support Repository v23.0.0 Android Support appcompat-v7:22.2.1 So let's get started: Step 1: Add below line into apps build.gradle. compile 'com.android.support:percent:23.0.0' Step 2: Add any one of below as the parent of the layout.Its similar to our RelativeLayout or FrameLayout. < android . support . percent . PercentRelativeLayout > or < android . support . percent . PercentFrameLayout > Step 3: Now we gonna use layout_heightPercent and layout_widthPercent property's to specify our height and width i...
Learn with Samples