1
私はアンドロイドに新しいので、私は科学計算機を構築しようとしていました。だから私はedit text
計算の結果を表示している。コンポーネントが重なり合っています
私がやっていたことは、その上にボタンを用意して、人々が電卓の前進機能にアクセスできるようにすることでした。
私は様々な質問を読んでそれを試みましたが、うまくいかないようです。
明らかに重複しています。
しかしedittext
は、imagebutton
の上に表示され、クリックイベントはimagebutton
で役に立たなくなります。私はedittext
の上に私のimagebutton
を置く方法
コード
<ImageButton
android:contentDescription="View advance features"
android:layout_width="50dp"
android:layout_height="50dp"
android:id="@+id/go_advance"
android:scaleType="fitXY"
android:layout_alignParentTop="@id/linearLayout"
android:layout_alignParentBottom="@id/linearLayout"
android:background="@drawable/round_buttons"
/>
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_constraintBottom_toTopOf="parent"
app:layout_constraintEnd_toStartOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<EditText
android:id="@+id/editText3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="fill_horizontal"
android:height="225dp"
android:textSize="24sp"
android:gravity="end|bottom"
android:ems="10"
android:maxLines="2"
android:inputType="textMultiLine"
tools:layout_editor_absoluteX="104dp"
tools:layout_editor_absoluteY="207dp" />
?
LinearLayoutの必要はありません。 RelativeLayoutの代わりに、このUIのための完璧なコンテナと思われるGridLayoutを使用します。 –
'相対>線形(テキスト+グリッドレイアウトの編集)、画像ボタン'これは実際の構造です –
私はそれを得る、何を言っているのですか、ありがとう@BernoulliGate –