-1
LinearLayout
내에서 앱을 실행할 때 화면에 4 개의 요소를 배치합니다 (첫 번째 행 3 개, 두 번째 행에 1 개, 화면 공간이 넉넉함) GridView
입니다. 페이지 하단의 GridView
과 별도로 추가 버튼을 추가하고 싶습니다. 나는 다음을 시도했다 :GridView에 추가 버튼을 추가하는 방법은 무엇입니까?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/select_route"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
tools:context="com.impyiablue.checkpoint.SelectRoute">
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/selectroute_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:columnWidth="90dp"
android:numColumns="auto_fit"
android:verticalSpacing="10dp"
android:horizontalSpacing="10dp"
android:stretchMode="columnWidth"
android:gravity="center"
/>
<LinearLayout
android:id="@+id/content"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingLeft="9dp"
android:paddingRight="9dp"
android:paddingTop="5dp"
android:layout_weight="1">
<Button android:id="@+id/finalCancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/check_redo"
android:background="@color/colorUndo"
android:textSize="20sp"
android:padding="25dip"
android:layout_marginBottom="50dp" />
</LinearLayout>>
</LinearLayout>
그러나 나는 여분의 버튼을 어디에서도 보지 못 하느냐? 내가 도대체 뭘 잘못하고있는 겁니까?
아래에있는
LinearLayout
에. 성능 향상을 위해 가능한 한 평평하게 디자인을 유지하십시오. 그건 그렇고, LinearLayout은'layout_weight' 속성을 남용하고 있습니다. –
내부 선형 레이아웃이 필요하지 않습니다! – Xenolion