您的位置:首页 > 移动开发 > Android开发

android中的帧布局(frameLayout)

2016-04-08 20:12 543 查看
frameLayout的特点:

所有的子元素都默认放在这块区域的左上角,可以通过android:layout_gravity=" "语句改变控件在布局中的位置。后面的子元素会覆盖前面的子元素。

</pre>例:<pre name="code" class="html"><?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" >

<ProgressBar
android:layout_gravity="center"
android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<TextView
android:layout_gravity="center"
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="100%" />

</FrameLayout>



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: