码迷,mamicode.com
首页 > 移动开发 > 详细

Android控件之ImageView(显示图片的控件)

时间:2015-07-18 15:33:54      阅读:125      评论:0      收藏:0      [点我收藏+]

标签:

一、ImageView属性:

  android:src = "@drawable/ic_launcher"——ImageView的内容图像(可以和android:background = "#00000"同时使用)

  android:background = "@drawable/ic_launcher"——ImageView的背景图像

  android:background = "#00000"——ImageView的RGB颜色

 

 

 

二、布局文件中设置ImageView控件

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#f0f0f0"
        android:src="@drawable/ic_launcher" />
    
    <ImageView
        android:id="@+id/imageView2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/ic_launcher" />
    
    <ImageView
        android:id="@+id/imageView3"
        android:layout_width="match_parent"
        android:layout_height="20dp"
        android:background="#f0f0f0" />

</LinearLayout>

技术分享

Android控件之ImageView(显示图片的控件)

标签:

原文地址:http://www.cnblogs.com/LO-ME/p/4656865.html

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