Android layout Don';在Android中,当按下on EditText(键盘启动后)时,是否不想隐藏EditText视图?
在Android应用程序中 当我按下EditText时,它看起来如下所示: 我正在使用选项卡栏上方的textview和以下代码Android layout Don';在Android中,当按下on EditText(键盘启动后)时,是否不想隐藏EditText视图?,android-layout,keyboard,android-tabhost,android-softkeyboard,Android Layout,Keyboard,Android Tabhost,Android Softkeyboard,在Android应用程序中 当我按下EditText时,它看起来如下所示: 我正在使用选项卡栏上方的textview和以下代码 android:windowSoftInputMode="stateHidden|adjustResize|adjustPan" 在清单文件中,在按下EditText时隐藏选项卡。但它也隐藏文本视图和按钮,如下所示: 我不想隐藏textview,我只想隐藏tabbar xml文件 chatroom.xml: <?xml version="1.0" enco
android:windowSoftInputMode="stateHidden|adjustResize|adjustPan"
在清单文件中,在按下EditText时隐藏选项卡。但它也隐藏文本视图和按钮,如下所示:
我不想隐藏textview,我只想隐藏tabbar
xml文件
chatroom.xml:
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
chat_tab_list.xml:
请在这方面指导我
任何帮助都将不胜感激。表示您只需在选项卡栏上设置android:WindowsOfInputMode=“adjustPan”,而不能在文本输入上设置。这样,文本输入行为正常,向上滚动,但选项卡栏保持不变。文本输入应有android:windowSoftInputMode=“adjustResize”
,以便滚动。有关不同模式的详细信息,请参阅
根据您的编辑,这似乎是因为您的编辑文本位于选项卡小部件中。您应该使用adjustResize的软输入模式将编辑文本从外部移动到根线性布局中。试试这个
将此添加到具有您选项卡的AndroidManifest just in活动中
<activity
android:name="YourActivity"
android:windowSoftInputMode="adjustPan" >
</activity>
android:WindowsOfInputMode=“adjustPan”
On Tabbar的意思是:在TabHost或TabWidget上?谢谢。@Ponting您尝试了什么?我没有启动并运行模拟器。我将android:WindowsOfInputMode=“adjustPan”放在TabWidget中,将android:WindowsOfInputMode=“adjustResize”放在EditText中,将android:WindowsOfInputMode=“adjustPan”放在清单文件的活动中。当我按下EditText时,它会隐藏TabBar,而不是我想要的隐藏键盘。但剩余的屏幕也会向上移动(就像ActionBar从设备的屏幕向上移动)@Ponting我更新了我的答案。您应该将EditText从tab小部件移动到根LinearLayout中。我尝试了它。它不起作用。它还将TextView与TabBar一起隐藏。请将您的活动布局放在xml中file@Ponting请检查您是否正确地将标签添加到清单文件上的TabActivityClass哪个标签?我不明白。android:windowSoftInputMode=“adjustPan”我也有同样的问题,你有解决方案吗?
<LinearLayout
android:id="@+id/chat_list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:visibility="visible" >
<ListView
android:id="@+id/listView"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@color/white" >
</ListView>
<LinearLayout
android:id="@+id/text_entry"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
android:orientation="horizontal"
android:visibility="visible" >
<EditText
android:id="@+id/txt_inputText"
android:layout_width="125dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:hint="@string/enter_text"
android:inputType="text"
android:windowSoftInputMode="adjustResize" />
<Button
android:id="@+id/btn_Send"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_weight="0.2"
android:text="@string/send" />
</LinearLayout>
</LinearLayout>
<activity
android:name="YourActivity"
android:windowSoftInputMode="adjustPan" >
</activity>
<Activity>
android:windowSoftInputMode="adjustPan"
</Activity>