码迷,mamicode.com
首页 > 其他好文 > 详细

imageView相关属性

时间:2016-06-04 11:56:32      阅读:110      评论:0      收藏:0      [点我收藏+]

标签:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="com.example.imageview.MainActivity" >
    <!--  android:src:图片源
        android:scaleType
                center:取图片中间部分
                fitCenter:放大缩小到合适的大小 -->
    <ImageView 
        android:layout_width="160dp"
        android:layout_height="200dp"
        android:scaleType="center"
        android:src="@drawable/background"/>
    <ImageView 
        android:layout_width="160dp"
        android:layout_height="200dp"
        android:scaleType="fitCenter"
        android:src="@drawable/background"/>
    <RelativeLayout 
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        >
        <!-- adjustViewBounds: 自动调整视图的边界到合适的值-->
        <ImageView 
            android:id="@+id/image"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:src="@drawable/background"
            android:adjustViewBounds="true"
         />
        <Button 
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@id/image"
            android:text="button"/>
    </RelativeLayout>

</LinearLayout>

 

imageView相关属性

标签:

原文地址:http://www.cnblogs.com/fangg/p/5558397.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!