2012-04-30 15 views
2

私は、ScrollViewの内側にfills_parentというTableLayoutを持っています。ソフトキーボードが表示されている場合を除いて、すべての機能が完璧に機能します。これは、最後のいくつかのEditTextをあいまいにします。技術的には、キーボードが表示されずにスクリーンがすべてのコンテンツに適合するので、スクリーンをそれ以上スクロールすることはできません。キーボードが表示されているときは、キーボードを隠すことなく残りのEditTextを見るためにスクロールして下にスクロールすることはできず、ユーザーは下のEditTextの1つに値を選択して入力できるだけです。 thisを使用して、私が試してみた:AndroidソフトキーボードがScrollViewのEditTextを隠す

Window.SetSoftInputMode((int)SoftInput.AdjustPan); 

Window.SetSoftInputMode((int)SoftInput.AdjustResize); 

[Activity(WindowSoftInputMode = SoftInput.AdjustPan)] 

[Activity(WindowSoftInputMode = SoftInput.AdjustResize)] 

Window.SetFlags(WindowManagerFlags.AltFocusableIm, WindowManagerFlags.AltFocusableIm); 

キーボードがまったく上がってこなかっただけです。それは私が必要なものではありません。表示されているキーボードの上に表示されるようにコンテンツを調整して、キーボードが表示されている最下部のEditTextまでスクロールし続けることができます。非常に長いXMLからの抜粋。表は動的にコードに取り込まれます。

<ScrollView 
android:id="@+id/peScroll" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:layout_below="@id/security"> 
    <TableLayout 
    android:id="@+id/poweredEquip" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_centerVertical="true" 
    android:stretchColumns="*" 
    android:gravity="center" 
    android:padding="10dip">   
    <TableRow 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:background="@drawable/tab_bg_unselected" 
     android:gravity="center"> 
     <TextView 
     android:text="Serial" 
     android:textSize="15sp" 
     android:textColor="@android:color/black" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:ellipsize="middle" 
     android:gravity="center" 
     android:layout_column="1"/> 
    </TableRow> 
    </TableLayout> 
</ScrollView> 

答えて

1

おそらく最もエレガントな解決策ではなく、おそらく最後の行に大きなmarginBottomを追加することに決めました。

関連する問題