レイヤウィジェットのトピックに関するほぼすべての記事が、FrameLayoutsにつながります.FrameLayoutsは、XMLの出現順序に従ってスタックすることになっています。テストするために、ボタンとTextViewをxmlに入れ、TextViewがボタンと重なっていることを確認します。ボタンがテキストビューの前後に配置されているかどうかは関係ありません。ボタンは常に上に表示されます。誰かが私が間違っているのを見ることができますか?アンドロイド:FrameLayoutのボタン上にテキストビューのスタックがない理由
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.jdot.testloadingfragments.MainActivity">
<Button
android:id="@+id/btn_test"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text=" "
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="----------------------------------------------------------"/>
</FrameLayout>
ありがとう
。私は標高を避けていますが、ボタンが特殊なケースであることを知らなかった。 AppCompatには、共通のデザイン要素に最新のAPIレベルを使用させるテーマがあります。 –