zoukankan      html  css  js  c++  java
  • Android布局之FrameLayout

    框架布局(帧布局)是最简单的布局形式。所有添加到这个布局中的视图都以层叠的方式显示。第一个添加的控件被放在最底层,最后一个添加到框架布局中的视图显示在最顶层,上一层的控件会覆盖下一层的控件。这种显示方式有些类似于堆栈。

    示例代码

    <?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">
    
        <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
    
            <TextView
                android:layout_width="200dp"
                android:layout_height="200dp"
                android:background="#FF6143" />
    
            <TextView
                android:layout_width="150dp"
                android:layout_height="150dp"
                android:background="#7BFE00" />
    
            <TextView
                android:layout_width="100dp"
                android:layout_height="100dp"
                android:background="#FFFF00" />
        </FrameLayout>
    
        <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">
    
            <TextView
                android:id="@+id/textview1"
                android:layout_width="140dp"
                android:layout_height="140dp"
                android:layout_gravity="center"
                android:background="#FF33ffff" />
    
            <TextView
                android:id="@+id/textview2"
                android:layout_width="80dp"
                android:layout_height="80dp"
                android:layout_gravity="center"
                android:background="#FF33ccff" />
    
            <TextView
                android:id="@+id/textview3"
                android:layout_width="20dp"
                android:layout_height="20dp"
                android:layout_gravity="center"
                android:background="#FF3399ff" />
        </FrameLayout>
    </FrameLayout>

    效果图

  • 相关阅读:
    20190922 模拟
    poj3417 Network/闇の連鎖[树上差分]
    poj3280 Cheapest Palindrome[区间DP]
    poj3691 DNA repair[DP+AC自动机]
    BZOJ1030 [JSOI2007]文本生成器[DP+AC自动机]
    loj2424 「NOIP2015」子串[字符串DP]
    poj1038 Bugs Integrated, Inc.[状压DP]
    第05组 Beta冲刺 (2/5)(组长)
    第05组 Beta冲刺 (1/5)(组长)
    第05组 Alpha冲刺 总结(组长)
  • 原文地址:https://www.cnblogs.com/anywherego/p/5405808.html
Copyright © 2011-2022 走看看