android: how do I add padding to a LinearLayout inside a FrameLayout -
i have framelayout many children. 1 of children linearlayout. want width of linearlayout match_parent
90% so; means want add sort of paddingleft/right
or margingleft/right
. when add padding or margin, not applied in graphical layout. how do correctly?
<framelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/blue" > <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center_horizontal" android:background="@color/red" android:marginleft="20dp" android:marginright="20dp" android:orientation="vertical" > ....
you have
android:marginleft="20dp" android:marginright="20dp"
instead change to:
android:layout_marginleft="20dp" android:layout_marginright="20dp"
if still doesnot work, put layout inside layout , set margins other layout.
Comments
Post a Comment