こんばんは(スウェーデンから)!いくつかの複合ビュー (1 つまたは複数のビューを含む拡張レイアウト) に基づいて GUI を構築していますが、フォーカス フローを正しく取得できないようです。私は主に、キーボードの「次へ」ボタンを正しく機能させたいと思っています。現在押してもクリック音が鳴る以外は何もしません。私が試してみました:
android:nextFocusRight="@+id/ipDecimal"
android:nextFocusDown="@+id/ipDecimal"
そして設定(あちこちで)
android:focusable="true"
私は何を間違っていますか?私の現在の目標は、最初の IntegerPicker から 2 番目の IntegerPicker にフォーカスを移すことです。
現時点で作業しようとしている 2 つのコンポーネントのレイアウトは次のとおりです (どちらも拡張 FrameLayout で構成されています)。
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:focusable="true" >
<com.SverkerSbrg.Spendo.Graphics.InsertTransaction.IntegerPicker
android:id="@+id/ipInteger"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
custom:NumberSize="40"
custom:TextAlignRight="true"
android:focusable="true"
custom:maxNrOfDigits="3"
android:nextFocusRight="@+id/ipDecimal"
android:nextFocusDown="@+id/ipDecimal">
<requestFocus />
</com.SverkerSbrg.Spendo.Graphics.InsertTransaction.IntegerPicker>
<TextView
android:id="@+id/tvDot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:text="."
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="30sp"
tools:ignore="HardcodedText" />
<com.SverkerSbrg.Spendo.Graphics.InsertTransaction.IntegerPicker
android:id="@+id/ipDecimal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:focusable="true"
custom:NumberSize="20"
custom:TextAlignRight="false"
custom:maxNrOfDigits="2" >
</com.SverkerSbrg.Spendo.Graphics.InsertTransaction.IntegerPicker>
<TextView
android:id="@+id/tvSpace"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"/>
<com.SverkerSbrg.Spendo.Graphics.InsertTransaction.CurrencyPicker
android:id="@+id/icCurrency"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
custom:textSize="20"
android:layout_gravity="bottom|center_horizontal">
</com.SverkerSbrg.Spendo.Graphics.InsertTransaction.CurrencyPicker>
</merge>
.
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"
>
<EditText
android:id="@+id/etInteger"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:inputType="number"
android:background="#00000000"
android:selectAllOnFocus="true"
android:focusable="true"
android:hint="00">
</EditText>
</merge>