不要想隐藏EditText上查看时的EditText是$ P $ Android中pssed(后键盘川方)? [英] Don't want to hide EditText View when on EditText is pressed (After keyboard comeup) in Android?
问题描述
在Android应用程序,
In Android Application,
当我pssed上的EditText $ P $那么它看起来像如下:
when I pressed on EditText then it looks like as below :
我使用的TextView以上的TabBar及以下code
I am using textview above tabbar and following code
android:windowSoftInputMode="stateHidden|adjustResize|adjustPan"
在manifest文件中隐藏的选项卡时的EditText为pressed.But它也隐藏如下文本视图和按钮:
in manifest file to hide tabs when EditText is pressed.But it also hides text view and button as below :
我不想隐瞒TextView的,我只是想隐藏的TabBar。
I dont want to hide textview , I just want to hide tabbar.
xml文件
chatroom.xml:
chatroom.xml :
<?xml version="1.0" encoding="utf-8"?>
<TabHost
android:id="@+id/tabHost"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1" >
<include layout="@layout/chat_tab_list" />
</FrameLayout>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:windowSoftInputMode="adjustPan"
>
</TabWidget>
</LinearLayout>
</TabHost>
chat_tab_list.xml:
chat_tab_list.xml :
<?xml version="1.0" encoding="utf-8"?>
<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>
请指导我在此。
任何帮助将AP preciated。
Any help will be appreciated.
推荐答案
这个问题表示您应该能够只需设置的android:windowSoftInputMode =adjustPan
标签栏上,但不是在文字输入。通过这种方式,在文字输入行为正常,滚动起来,但标签栏原地踏步。文本输入应该有的android:windowSoftInputMode =adjustResize
,使其滚动。请参见对不同模式的细节此页面。
This question indicates that you should be able to just set the android:windowSoftInputMode="adjustPan"
on the tab bar, but not on the text input. This way, the text input behaves normally, scrolling up, but the tab bar stays put. The text input should have android:windowSoftInputMode="adjustResize"
so that it scrolls. See this page for details on the different modes.
根据您的编辑,它看起来像,那是因为你的编辑文本是标签控件中。你应该之外将编辑文本到根的LinearLayout与adjustResize软输入模式。
Based on your edit, it looks like it's because your edit text is inside the tab widget. You should move the Edit Text outside into your root linearLayout with the soft input mode of adjustResize.
这篇关于不要想隐藏EditText上查看时的EditText是$ P $ Android中pssed(后键盘川方)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!