FrameLayout具有属性android:foreground,android:foregroundGravity和android:measureAllChildren.我已经尝试过这些属性,但无法弄清楚它们如何影响布局的外观或它们的工作方式.
<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"
android:foreground="@android:color/holo_blue_dark"
android:foregroundGravity="center"
android:measureAllChildren="true"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.framelayoutdemo.MainActivity" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/btn_dialog" />
</FrameLayout>
Run Code Online (Sandbox Code Playgroud)
我用谷歌搜索,但无法找到这些属性的帮助.请给我一个链接,我可以参考或帮助我举个例子.谢谢