zoukankan      html  css  js  c++  java
  • AbsoluteLayout和FrameLayou

    AbsoluteLayout(不推荐使用):

     <TextView 
            android:layout_x="10px"
            android:layout_y="10px"
            android:background="#00FF00"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/hello"
            /> 
    View Code

    FrameLayou:

    相互覆盖的一个列子:

    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        >
        <TextView 
            android:layout_width="200dp"
            android:layout_height="200dp"
            android:background="#FF0000"
            />
        <TextView 
            android:layout_width="100dp"
            android:layout_height="300dp"
            android:background="#00FF00"
            />
    </FrameLayout>
    View Code

    设置相互重叠的的层叠效果:

    <TextView 
            android:layout_width="320dp"
            android:layout_height="320dp"
            android:background="#000011"
            android:layout_gravity="center"  //设置控件的相对位置
            />
            <TextView 
            android:layout_width="280dp"
            android:layout_height="280dp"
            android:background="#004433"
            android:layout_gravity="center"
            />
            <TextView 
            android:layout_width="240dp"
            android:layout_height="240dp"
            android:background="#00aa00"
            android:layout_gravity="center"
            />
            <TextView 
            android:layout_width="200dp"
            android:layout_height="200dp"
            android:background="#00dd00"
            android:layout_gravity="center"
            />
    View Code
  • 相关阅读:
    OpenGL 一
    Git-SSH
    CGAffineTransform 视频旋转
    UI学习笔记---第十一天UITableView表视图高级-自定义cell
    UI学习笔记---第十天UITableView表视图编辑
    UI学习笔记---第九天UITableView表视图
    UITextView 点return 隐藏键盘
    UI学习笔记---第八天
    UI学习笔记---第七天
    UI学习笔记---第六天
  • 原文地址:https://www.cnblogs.com/zhang1107/p/3125469.html
Copyright © 2011-2022 走看看