android 学习

帧布局

帧布局除了前面的RelatitveLayout(相对布局)介绍的通用属性外,还有两个特殊属性

android:foreground:*设置改帧布局容器的前景图像

android:foregroundGravity:设置前景图像显示的位置

 1 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"    
 2     xmlns:tools="http://schemas.android.com/tools"    
 3     android:id="@+id/FrameLayout1"    
 4     android:layout_width="match_parent"    
 5     android:layout_height="match_parent"    
 6     tools:context=".MainActivity"     
 7     android:foreground="@drawable/logo"    
 8     android:foregroundGravity="right|bottom">    
 9     
10     <TextView    
11         android:layout_width="200dp"    
12         android:layout_height="200dp"    
13         android:background="#FF6143" />    
14     <TextView    
15         android:layout_width="150dp"    
16         android:layout_height="150dp"    
17         android:background="#7BFE00" />    
18      <TextView    
19         android:layout_width="100dp"    
20         android:layout_height="100dp"    
21         android:background="#FFFF00" />    
22         
23 </FrameLayout>
原文地址:https://www.cnblogs.com/Nojava/p/14907329.html