zoukankan      html  css  js  c++  java
  • RelativityLayout 子控件的几个常用的属性 android:layout_centerHorizontal="true"、 android:layout_centerVertical="true" 、android:layout_centerInParent="true"

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >
    
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent" >
    
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_launcher" />
           
        </RelativeLayout>
    
    </LinearLayout>
    

    ------------------------------------------------------------------------------------------

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >
    
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent" >
    
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:src="@drawable/ic_launcher" />
    
            <!--
               android:layout_centerVertical="true" 
               android:layout_centerInParent="true"
    
            -->
    
        </RelativeLayout>
    
    </LinearLayout>
    

        android:layout_centerHorizontal="true"         RelativityLayout没有此属性

    ------------------------------------------------------------------------------------------

     

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >
    
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent" >
    
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
               android:layout_centerInParent="true"
                android:src="@drawable/ic_launcher" />
    
        </RelativeLayout>
    
    </LinearLayout>
    

       android:layout_centerInParent="true"         RelativityLayout没有此属性

    ------------------------------------------------------------------------------------------

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >
    
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent" >
    
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
               android:layout_centerVertical="true"
                android:src="@drawable/ic_launcher" />
    
        </RelativeLayout>
    
    </LinearLayout>
    

       android:layout_centerVertical="true"        RelativityLayout没有此属性

    ------------------------------------------------------------------------------------------

  • 相关阅读:
    IOS微信浏览器返回事件popstate监听
    图解用HTML5的popstate如何玩转浏览器历史记录
    如何在深层嵌套ngRepeat中获取不同层级的$index
    angular ng-repeat 如何实现嵌套
    AJAX的工作原理
    利用angular指令监听ng-repeat渲染完成后执行脚本
    AngularJS中$http服务的简单用法
    AngularJS的Filter用法详解
    angularJS发起$http.post请求后台收不到数据解决方案
    AngularJs的UI组件ui-Bootstrap分享(十四)——Carousel
  • 原文地址:https://www.cnblogs.com/childhooding/p/4422232.html
Copyright © 2011-2022 走看看