android背景图按比例缩放方法

时间:2015-03-09 22:28:03   收藏:0   阅读:681

直接在你的layout文件的开头加一个FrameLayout ,里面放一个ImageView,因为只有android:src可以设置android:scaleType,android:background是无法设置的,我的代码:

<?xml version="1.0" encoding="utf-8"?> 

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

<ImageView
android:layout_width="fill_parent" 
            android:layout_height="fill_parent"
android:src="@drawable/main_background_normal_nextchapter"
android:scaleType = "centerCrop"
/>

</FrameLayout>




原文:http://blog.csdn.net/only2xlr/article/details/44161283

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!