나는 안드로이드와 함께 일하고 있는데, 나는 화면의 맨 아래에 항상 수평으로 세 개의 버튼이 있어야하는 XML 디자인을 만들어야한다. 안드로이드의 페이스 북 응용 프로그램과 마찬가지로, 화면 하단에 3 개의 버튼 (상태, 사진, 체크인)이 있습니다. 마찬가지로 응용 프로그램에는 항상 3 개의 버튼이 있어야합니다.안드로이드의 facebook처럼 화면 하단에 3 개의 버튼을 표시하는 방법은 무엇입니까?
레이아웃의 종류는 어떻게됩니까?
나는 아래의 XML 디자인 시도했지만 어떻게 든 작동하지 않습니다 그들은 모두 수직오고있다 -
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/db1_root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/cow"
android:layout_weight="0"
android:textAppearance="?android:attr/textAppearanceLarge" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:gravity="center|bottom"
android:orientation="vertical" >
<Button
android:id="@+id/button1"
style="?android:attr/buttonStyleSmall"
android:layout_width="145dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center"
android:text="ButtonA" />
<Button
android:id="@+id/button2"
style="?android:attr/buttonStyleSmall"
android:layout_width="145dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center"
android:text="ButtonB" />
<Button
android:id="@+id/button3"
style="?android:attr/buttonStyleSmall"
android:layout_width="145dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center"
android:text="ButtonC" />
</LinearLayout>
</LinearLayout>
난 그냥 단지 페이스 북의 쇼처럼 수평으로 화면 아래쪽에 세 개의 버튼을 표시해야 항상 나란히 (서로 닿아). 가능한가요? 버튼 이름이 될 수
- 레이아웃 아래 ButtonA, ButtonB and ButtonC
레이아웃에서 6 개의 버튼이 선언 된 이유는 무엇입니까? – joao2fast4u
RelativeLayout의 'buttons.layout_below' 아래쪽에있는 LinearLayout의 버튼이있는 ScrollView가 필요할 것입니다. – ChiefTwoPencils
LinearLayout에'android : orientation = "vertical"'이 있기 때문에 수직입니다. 그것을 수평으로 변경하십시오. – Karakuri