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没有此属性

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

  • 相关阅读:
    主成分分析(PCA)原理详解_转载
    用eclipse怎么打war包?
    dsLinq.Count() 引发了“System.NullReferenceException”类型的异常
    sql中实现split()功能
    关于SQL Server将一列的多行内容拼接成一行,合并显示在另外表中
    SEM和SEO的区别?
    最适合程序员转行的10大职业
    CPM、CPC、CPA、PFP、CPS、CPL、CPR等广告术语是什么意思
    什么是CPC,CPA,CVR,CTR,ROI
    SQL SERVER 修改数据库名称(包括 db.mdf 名称的修改)
  • 原文地址:https://www.cnblogs.com/childhooding/p/4422232.html
Copyright © 2011-2022 走看看