好了,所以我有一個抽屜佈局的friendslist功能,像這樣:如何停止鍵盤在Drawerlayout中扭曲ListView?
正如你所看到的,我需要的LinearLayout的某種方式持有的EditText和按鈕來推動它上面的列表視圖向上,而不是出現在它之上。我怎樣才能做到這一點?
編輯:我的代碼,如
<RelativeLayout
android:id="@+id/relative_layout"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start" >
<ListView
android:id="@+id/left_drawer"
android:layout_width="300dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#111"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_alignParentBottom="true">
<EditText
android:id="@+id/edit_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Enter friend name" />
<Button
android:id="@+id/button_send"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="sendMessage"
android:text="Add" />
</LinearLayout>
</RelativeLayout>
是否可以將'ListViews'高度設置爲'wrap_content'而不是'match_parent'? –
發佈您的佈局xml代碼 –
沒有區別我害怕@XaverKapeller。 – Chucky