android - place and align a button above 4 views -
i want place button above 4 other views:
the views b1-b4 not buttons, , behave buttons (clickable , focusable). equal spacing desirable.
i have found evenly spaced out row of buttons required how make button0 occupy width of b1-b4?
try this.
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="20dp" android:orientation="vertical" > <button android:id="@+id/button1" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="button0" /> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" > <button android:id="@+id/button2" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="b1" /> <button android:id="@+id/button3" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="b2" /> <button android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="b3" /> <button android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="b4" /> </linearlayout> </linearlayout>
now let me know, helpful or not..??
Comments
Post a Comment