2013-03-06 2 views
4

Я знаю, что подобные вопросы заданы раньше, но я не могу понять, что делать с моим макетом.Soft Keyboard перекрывает EditText в TabHost

Проблема: Клавиатура перекрывает AutoCompleteTextView, когда к ней добавляются несколько строк. Я попробовал обернуть все в scrollview и так далее, но это не помогло. enter image description here Любая помощь будет оценена по достоинству.

Заранее спасибо

<?xml version="1.0" encoding="utf-8"?> 
<TabHost xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@android:id/tabhost" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 
    <LinearLayout 
     android:orientation="vertical" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 
     <HorizontalScrollView 
      android:id="@+id/tabsScroll" 
      android:layout_width="fill_parent" 
      android:fadingEdge="horizontal" 
      android:fillViewport="true" 
      android:layout_height="wrap_content" 
      android:scrollbars="@null"> 
      <TabWidget 
       android:id="@android:id/tabs" 
       android:orientation="horizontal" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:layout_weight="0" /> 
     </HorizontalScrollView> 
     <FrameLayout 
      android:id="@android:id/tabcontent" 
      android:layout_width="0dp" 
      android:layout_height="0dp" 
      android:layout_weight="0" /> 
     <android.support.v4.view.ViewPager 
      android:id="@+id/pager" 
      android:layout_width="match_parent" 
      android:layout_height="0dp" 
      android:layout_weight="1" /> 
     <ScrollView 
      android:minWidth="25px" 
      android:minHeight="25px" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:id="@+id/scrollView1"> 
      <LinearLayout 
       android:orientation="vertical" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:id="@+id/InputOuterContainer" 
       android:layout_alignParentBottom="true"> 
       <View 
        android:background="#ffcccccc" 
        android:layout_width="fill_parent" 
        android:layout_height="1.0px" /> 
       <LinearLayout 
        android:orientation="horizontal" 
        android:layout_width="fill_parent" 
        android:background="#FFFFFF" 
        android:layout_height="wrap_content" 
        android:id="@+id/InputContainer"> 
        <AutoCompleteTextView 
         android:id="@+id/InputTextView" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:hint="@string/Ready" 
         android:layout_weight="1.0" 
         android:imeOptions="actionGo" 
         android:inputType="textNoSuggestions" 
         android:selectAllOnFocus="true" 
         android:focusable="true" /> 
        <ImageButton 
         android:id="@+id/ButtonRun" 
         android:paddingLeft="16.0dip" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:src="@drawable/go" 
         android:scaleType="center" 
         style="?android:attr/borderlessButtonStyle" 
         android:layout_gravity="top" /> 
       </LinearLayout> 
      </LinearLayout> 
     </ScrollView> 
    </LinearLayout> 
</TabHost> 
+0

попробуйте установить андроид: windowSoftInputMode = атрибут "adjustPan" в манифесте. – animaonline

+1

это действительно сработало ... но заголовки вкладок теперь скрыты – jjdev80

+0

android: windowSoftInputMode = "adjustResize" может ли этот атрибут помочь u в настройке u r ui для запуска клавиатуры. –

ответ

2

Хорошо, в манифесте, добавьте андроида: windowSoftInputMode к вашей деятельности,

проверить это: http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft

затем установите андроида: windowSoftInputMode к adjustPan или adjustResize

+2

Я пробовал, что это не сработало, см. Мой комментарий. – jjdev80

0

Я добавил эту строку в теге Scrollview:

android:isScrollContainer="false" 
Смежные вопросы