下來,這是我的代碼:Android。將一個靜態的按鈕在屏幕
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center" >
</ListView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="end"
>
<EditText
android:id="@+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.73"
android:ems="10" />
<Button
android:id="@+id/button1"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/enviar" />
</LinearLayout>
它沒有運行我怎麼想。我需要列表視圖有一個靜態大小:所有屏幕 - 其餘對象。我需要列表視圖在頂部。
問題是,如果我把android:layout_height =「match_parent」列表視圖的大小是所有屏幕。如果我把android:layout_height =「wrap_content」的大小設置爲可變的,並且當我有很多元素時,剩下的對象是不可見的。
我需要列表視圖中的對象總是可見的。有些類似於WhatsApp對話屏幕。你明白我說的嗎?對不起,我的英語不好:)
這是解決方案。謝謝!!! – user3235831
@ user3235831請閱讀http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work因爲你是新來的stackoverflow – Raghunandan
如果我使用其他手機,視圖是類似的? – user3235831