zoukankan      html  css  js  c++  java
  • Android之界面(布局文件layput)

    1。关于组件居中

     ① android:layout_gravity="center"
    控件在包含该控件的父控件中的位置。同样,当我们在Button按钮控件中设置android:layout_gravity="left"属性时,表示该Button按钮将位于界面的左部。
    ②android:scaleType="center"截取图片中间显示 
    ③   android:scaleType="centerInside"
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical"
       
        >
    
        <TextView 
            android:id="@+id/tv_title"
               android:layout_width="match_parent"
               android:layout_height="0dp"
               android:layout_weight="1"
               android:text="个人中心"
               android:gravity="center"
               android:textSize="30px"
               android:background="#44cef6"
         />
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="4"
                android:gravity="center"
            >
                <ImageView
                    android:id="@+id/img_me"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:src="@drawable/ic_launcher" />
            </LinearLayout>
            
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="5"
            >
                <GridView
                    android:id="@+id/person_grid_view"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:numColumns="3" 
                    android:stretchMode="columnWidth">
                </GridView>
        
            </LinearLayout>
    </LinearLayout>
     
  • 相关阅读:
    [译]rabbitmq 2.1 Consumers and producers (not an economics lesson)
    mysql存储过程执行权限问题
    修改linux端口范围 ip_local_port_range
    centos6 自启动任务
    randomize_va_space
    linux 捕获信号处理中遇到的死锁
    squid基础配置
    [转]你应该了解的 一些web缓存相关的概念
    libevent简介 构成
    Libevent windows/linux下编译
  • 原文地址:https://www.cnblogs.com/chenxiaomeng/p/5869515.html
Copyright © 2011-2022 走看看