FrameLayout帧布局,简单的说FrameLayout中的子元素总是以屏幕的左上角层叠在一起,但是,这里就存在了一个问题,如何让控件显示在屏幕的中间呢?
事实上,我们可以对子元素添加android:layout_gravity属性来设置他们的位置:
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
android:id="@+id/image"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="center"
android:src="@drawable/ic_launcher"
/>
android:id="@+id/text1"
android:layout_width="wrap_conten