温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

android基础之FrameLayout布局

发布时间:2020-07-20 13:12:03 来源:网络 阅读:410 作者:hagar 栏目:移动开发

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>

运行如下:

android基础之FrameLayout布局


向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI