android基础之FrameLayout布局
FrameLayout布局:
单帧布局在新定义组件的时候永远会将组件放置在屏幕的左上角,即使在此布局中定义多个组件,后一个组件总会将前一个组件所覆盖,除非后一个组件是透明的。
代码如下:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="button1"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="button2"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="button3"
/>
</FrameLayout>
运行如下:
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。