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>

  • 相关阅读:
    windows 启动关闭Oracle监听和服务
    自定义 Git
    c++ cmakelist 详解
    vue自定义错误界面
    C++ Web 编程
    前端如何将H5页面打包成本地app?
    django教程
    部署 Django
    Django 国际化和本地化
    Django与CSRF 、AJAX
  • 原文地址:https://www.cnblogs.com/yongyuandishen/p/14865994.html
Copyright © 2011-2022 走看看