首页 > 移动平台 > 详细

android背景图按比例缩放方法

时间:2015-03-09 22:28:03      阅读:678      评论:0      收藏:0      [点我收藏+]

直接在你的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>




android背景图按比例缩放方法

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!