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>

  • 相关阅读:
    python基础之流程控制
    多线程---阻塞队列
    多线程---线程同步
    多线程---线程实现
    多线程start();之后会开辟新的栈空间
    java中使用String的split分隔字符串注意事项
    IO流
    java中的多态
    关于java中的接口
    关于final关键字
  • 原文地址:https://www.cnblogs.com/yongyuandishen/p/14865994.html
Copyright © 2011-2022 走看看