requestFocus пропускает следующий EditText

У меня проблемы с фокусировкой управления. Мое определение интерфейса ниже имеет:

источник (RadioGroup / необязательно) место назначения (EditText) количество (EditText) transfer (Button)

Я изменяю видимость «источника» в моем коде. Когда я его не показываю, фокус автоматически переходит на «количество», которое, как я ожидал, вместо этого будет «местом назначения». Я не знаю, что мне не хватает. Я подозреваю, что это может быть ошибка Android, я не знаю. Кто-нибудь знает, как это решить?

Спасибо

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <RadioGroup android:id="@+id/source"
     android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:orientation="vertical"
   android:visibility="gone">
   <RadioButton android:id="@+id/default"
    android:checked="false"
    android:text="@string/default"/>
 </RadioGroup>

 <TableLayout
  android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:stretchColumns="1">
     <TableRow>
   <TextView 
    android:text="@string/destination"
    android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:textSize="16sp"
       android:textColor="#ffffff"
       android:paddingRight="10sp"
       android:layout_weight="1"/>

      <EditText android:id="@+id/destination"
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content"
       android:layout_weight="1"
       android:singleLine="true"><requestFocus/></EditText>
  </TableRow>

  <TableRow>
   <TextView 
    android:text="@string/quantity"
    android:layout_width="wrap_content" 
       android:layout_height="wrap_content"
       android:textSize="16sp"
       android:textColor="#ffffff"
       android:paddingRight="10sp"
       android:layout_weight="1"/>

      <EditText android:id="@+id/quantity"
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content"
       android:layout_weight="1"
       android:singleLine="true"/>
  </TableRow>
 </TableLayout>

 <Button android:id="@+id/transfer"
  android:layout_width="fill_parent" 
     android:layout_height="wrap_content"
     android:text="@string/transfer"/>
</LinearLayout>
8
задан ElefantPhace 28 March 2013 в 02:03
поделиться