1
listFragment 레이아웃의 xml 파일에 단추를 배치 할 때마다 ListView에 단추가 추가됩니다. 내가 원하는 건 조각의 ListView 아래에 2 개의 단추가 있습니다.ListFragment에 버튼을 추가하는 방법
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/peersFragment" >
<ListView
android:id="@+id/android:list"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<TextView
android:id="@+id/android:empty"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<LinearLayout
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:orientation="vertical" >
<TextView
android:id="@+id/device_name"
android:layout_width="wrap_content"
android:layout_height="20dp"
android:textSize="20sp"
android:textStyle="bold"
android:singleLine="true"/>
<TextView
android:id="@+id/device_address"
android:layout_width="wrap_content"
android:layout_height="26dp"
android:singleLine="true"/>
</LinearLayout>
</RelativeLayout>
이 ListFragment 레이아웃이 있습니다. 단추가 목록 아래에 있음을 어떻게 지정해야합니까?
각 요소에 2 개의 버튼을 추가 하시겠습니까? 그렇다면 맞춤 어댑터를 사용해야합니다. [여기에 안드로이드의 ListView에 대한 기사와 직접 만드는 방법에 대한 기사] (http://www.vogella.com/tutorials/AndroidListView/article.html#adapterown) –
이 목록보기는 다른 와이파이 직접 장치를 보여줍니다. 그래서 나는 listview 아래에 스캔 버튼을 추가하고 싶다. 사용자가 기기를 찾을 수있게합니다. – user3553551
RelativeLayout을 LinearLayout으로 변경하고 단추를 그런 식으로 배치 할 수 없습니까? –