Android 文本编辑在键盘上消失
那个布局有什么问题 1) 当我以纵向模式打开应用程序时,此文本编辑可见,直到我单击它以输入一些文本(只有黑色)。如果我将其转换为横向模式,文本编辑将再次出现(在全屏模式下) 2) 当我在横向模式下打开应用程序时,只有版面标题和下面的黑色 这似乎不太复杂。。 以下是伪xml:Android 文本编辑在键盘上消失,android,android-layout,Android,Android Layout,那个布局有什么问题 1) 当我以纵向模式打开应用程序时,此文本编辑可见,直到我单击它以输入一些文本(只有黑色)。如果我将其转换为横向模式,文本编辑将再次出现(在全屏模式下) 2) 当我在横向模式下打开应用程序时,只有版面标题和下面的黑色 这似乎不太复杂。。 以下是伪xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1.85"
android:orientation="horizontal" android:layout_marginTop="10px">
<EditText
android:id="@+id/editText1"
android:layout_width="299dp"
android:layout_height="wrap_content"
android:layout_weight="1" android:lines="1"/>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="clear" />
</LinearLayout>
<ListView
android:id="@+id/mylist"
android:layout_height="413dp"
android:layout_weight="0.52" android:layout_width="fill_parent">
</ListView>
</LinearLayout>
你能帮我修复这个布局或者给我一些更好的例子吗?你有一个高度为413dp(相当大)的列表视图。我想你误解了布局权重决定了如何分配多余的空间,如果你的listview很大的话,就不会有太多多余的空间 您可能希望将水平线性布局设置为没有布局权重,并告诉listview全部使用它:
<row>
<col. for text>
<col. for button>
</row>
<row>
<some text here>
</row>
您有一个高度为413dp(相当大)的列表视图。我想你误解了布局权重决定了如何分配多余的空间,如果你的listview很大的话,就不会有太多多余的空间 您可能希望将水平线性布局设置为没有布局权重,并告诉listview全部使用它:
<row>
<col. for text>
<col. for button>
</row>
<row>
<some text here>
</row>