FrameLayout布局

来源:互联网 发布:科学管理案例 知乎 编辑:程序博客网 时间:2024/05/01 14:53

FrameLayout布局中,不能控制子控件的位置,子控件默认放人FrameLayout的左上角。

XML布局例子如下:

<?xml version="1.0" encoding="utf-8"?><FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent" >    <TextView        android:id="@+id/h1"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:text="@string/app_name" />     <TextView        android:id="@+id/h3"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:text="@string/hello_world" />           <TextView        android:id="@+id/h2"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:text="@string/search" /> </FrameLayout>

0 0
原创粉丝点击