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

图片的android:src 及android:background共存

时间:2014-12-08 10:31:25      阅读:123      评论:0      收藏:0      [点我收藏+]

标签:android   style   blog   http   ar   color   sp   div   2014   

---恢复内容开始---

需求:给ImageView添加背景色

效果:

bubuko.com,布布扣

实现分析:

1.目录结构:

bubuko.com,布布扣

代码实现:

1.activity_main.xml

<merge xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" >

    <ImageView
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_centerInParent="true"
        android:layout_gravity="center"
        android:background="@android:color/white"
        android:padding="30dp"
        android:src="@drawable/ic_launcher" />

</merge>

代码:http://pan.baidu.com/s/1dDxmWXr

图片的android:src 及android:background共存

标签:android   style   blog   http   ar   color   sp   div   2014   

原文地址:http://www.cnblogs.com/sishuiliuyun/p/4150465.html

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