私が導入しようとしているこの問題は、Android 4.0 でのみ発生します +
4 つの TableLayout を持つ LinearLayout があり、その親は ScrollView です。TableRows を各 TableLayout に動的に追加します。
私のTableRowsはこのようなものです。
<TableRow xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tableRow1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/borda"
android:layout_margin="10dip"
android:paddingLeft="10dip"
>
<LinearLayout
android:id="@+id/l1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="15dip"
android:layout_marginBottom="15dip"
>
<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/nome"
android:textStyle="bold"
android:textColor="#526691"
android:textSize="15sp"
android:paddingLeft="10dip"
android:paddingRight="5dip"
/>
<EditText
android:id="@+id/valorLabel"
android:layout_width="140dip"
android:layout_height="wrap_content"
android:textSize="15sp"
android:background="#ffffffff"
android:singleLine="true"
android:inputType="textCapSentences"
android:textColor="#777777" />
</LinearLayout>
</TableRow>
フォーカスされた EditText が画面外にスクロールされると問題が発生するようです。
質問 EditText が画面に表示されているかどうかを知るにはどうすればよいですか? 親がスクロールされている場合、EditText でフォーカスを削除する方法はありますか?
2 番目の質問
EditText にフォーカスがあると、TableRow の背景が白くなるのはなぜですか?