zoukankan      html  css  js  c++  java
  • Android学习第六天

    FrameLayout又称作帧布局,这种布局没有丰富的定位方式,所有的控件都会默认摆放在布局的左上角。
    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <TextView
    android:id="@+id/textView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="This is TextView"
    />
    <Button
    android:id="@+id/button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Button"
    />
    </FrameLayout>

    除了默认效果之外,还可以使用layout_gravity属性来指定控件在布局中的对齐方式,这
    和LinearLayout中的用法是相似的。
    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <TextView
    android:id="@+id/textView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="left"
    android:text="This is TextView"
    />
    <Button
    android:id="@+id/button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="right"
    android:text="Button"
    />
    </FrameLayout>

  • 相关阅读:
    Storyboard里面的几种Segue区别和视图的切换
    2014年12月英语单词
    测试和调试的区别
    黑苹果安装教程(一)
    IOS基础——IOS学习路线图(一)
    遇到Wampserver遇到的问题
    产生不重复的数字
    简单的布局
    2014年8月
    算法小全
  • 原文地址:https://www.cnblogs.com/yongyuandishen/p/14865994.html
Copyright © 2011-2022 走看看