Note that there are some explanatory texts on larger screens.

plurals
  1. POEditText focus inconsistent across layouts
    primarykey
    data
    text
    <p>I have two different main.xml files, one for portrait, one for layout. Each one has this code inside of a RelativeLayout inside of a Scrollview.</p> <pre><code>&lt;LinearLayout android:id="@+id/name_phone" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/acquire" &gt; &lt;EditText android:id="@+id/name" android:inputType="textPersonName" android:layout_weight="1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:hint="observer name" android:nextFocusDown="@id/phone" android:background="@android:drawable/editbox_background" /&gt; &lt;EditText android:id="@+id/phone" android:inputType="phone" android:layout_weight="1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:hint="phone number" android:nextFocusDown="@id/phone" android:background="@android:drawable/editbox_background" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>etc ...</p> <p>The oddity is this: as far as I know, you are not supposed to be able to refer to things that haven't happened yet in xml, so android:nextFocusDown="@id/phone" should fail because phone hasnt been declared; and that is what happens in my landscape xml but not in portrait. In portrait it works perfectly and passes the focus through all four EditTexts with no hitch. If I put the NextFocusDown into the landscape, it will fail to compile, stating "No resource found that matches the given name (at 'nextFocusDown' with value '@id/phone')."</p> <p>A solution or explanation would be great. The idea is that I have four text boxes in two different LinearLayouts and whichever one has focus first will pass it to the EditText beneath it, skipping the others. I want it to work as I have it in portrait layout, when the user hits next on the name, focus moves to phone, when they hit next on that it moves to email, etc. I'm also curious as to why it is letting this work in portrait but not landscape.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload