Skip to content Skip to sidebar Skip to footer

Android Dp Size For Linearlayout

I want to add some centered elements to a LinearLayout(like textViews or buttons). If I use android:layout_width='fill_parent' the button can be too big on a large screen like a t

Solution 1:

Replace dp with sdp(scalable dp). This scales with the screen size. It can help you with supporting multiple screens.

Add this dependency in your gradle.

compile 'com.intuit.sdp:sdp-android:1.0.2'

Use like this:- android:paddingLeft ="@dimen/_5sdp"

Also use match_parent instead of fill_parent in LinearLayout's Height/Width

Hope this will help you.... :) :)

Post a Comment for "Android Dp Size For Linearlayout"