最近一个 项目 中,从网上下载一个图片,然后展示给 用户 看,那个图片本来是iphone里的,拿到android上来,一拉伸就出问题了,scrollview的顶部和底部出现了奇怪的黑块,如图: 在网上找了很资料都没解决,后来在一个外国 网站 找到结果,分享一下。 代码: <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android. com /apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="http://archive.cnblogs.com/a/2345498/@drawable/demo" rel=" nofollow "/> android:adjustViewBounds="true"
android:scaleType="centerInside"></ImageView>
</ScrollView>
</LinearLayout> android:adjustViewBounds="true"这句很关键

更多相关文章

  1. Android实现OCR扫描识别数字图片之图片扫描识别
  2. Android(安卓)选择图片、上传图片之PictureSelector
  3. Android高手进阶教程(十九)---Android中几种图像特效处理的集锦!
  4. Android之——史上最简单最酷炫的3D图片浏览效果的实现
  5. Android高手进阶教程(二十二)之---Android中几种图像特效处理的
  6. Android多媒体学习一:Android中Image的简单实例
  7. Android作业:一个3D相册源码
  8. Android多媒体学习一:Android中Image的简单实例。
  9. Android多媒体学习一:Android中Image的简单实例。

随机推荐

  1. Android之类似于黑名单的短信拦截
  2. swig android的使用
  3. android 复制字符串到剪贴板
  4. android中EditText只允许输入汉字(过滤汉
  5. android反射方式访问内部类成员
  6. Delphi XE5 android 捕获几个事件
  7. Android源码编译全过程
  8. android之渐变色背景
  9. android hardware 简述(Android系统源码情
  10. android 页面切换动画效果