Mam liniowy układ pionowy w rodzicu. Następnie poziomy układ liniowy na dnie w tym 3 przyciskiJak wyrównać 3 przyciski w linii, Android?
Chcę 1st przycisk w skrajnej lewej stronie aktywności w dolnym 2. środkowy przycisk i 3 przycisk w skrajnej prawej stronie
Oto xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/viewImageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:contentDescription="@null"
android:src="@drawable/ic_launcher" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_gravity="fill_vertical"
android:text="Button" />
</LinearLayout>
Thanks to działa na mnie – WISHY
@Wishy Jeżeli moja odpowiedź pomogła Ci, pls zaakceptować. Przejrzyj także moją edycję, aby uzyskać więcej wyjaśnień. – Hariharan