フレームレイアウトFrameLayout、最初の効果:
ソースコード:
<FrameLayout
android:id="@+id/myframe"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout_editor_absoluteX="1dp"
tools:layout_editor_absoluteY="1dp">
<TextView
android:layout_width="200dp"
android:layout_height="200dp"
android:background="#44E744"/>
<TextView
android:layout_width="100dp"
android:layout_height="100dp"
android:background="#F44336"
android:text="西电"
android:textColor="#F4FF00"
android:textSize="20sp"
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/testpic"></ImageView>
</FrameLayout>
ユニットの補足知識:
フレームレイアウト機能:次のコンポーネントは前のレイヤーをカバーします。アニメーションを実行して
、画像を挿入するImageViewを表示できます。srcは最初に画像をドローアブルにコピーしてから参照できます。