您的位置:首页 > 其它

一张图片的不同颜色的实现

2016-09-12 20:20 387 查看
xml中的实现

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
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"
tools:context="com.example.administrator.navigation.MainActivity">

<ImageView
android:id="@+id/iv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="center"
android:src="@mipmap/ic_launcher"/>

<ImageView
android:id="@+id/iv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/iv1"
android:src="@mipmap/ic_launcher"
android:tint="#3F51B5"
/>

<ImageView
android:id="@+id/iv3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/iv2"
android:scaleType="centerInside"
android:src="@mipmap/ic_launcher"
android:tint="#FF4081"
/>

</RelativeLayout>


效果图

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  xml 布局