android – ImageView 9补丁绘图与填充线不受尊重

我有这个 XML布局. frame_top_widget_holo是一个9-patch drawable,底部和右侧有填充线.它还在顶部和左侧有拉伸边界线.
它被设置为背景,有一个图像可绘制集作为源.结果显示两者,但src图像与drawable设置的填充重叠.问题是scaleType,所以我怀疑这可能是一个错误.有谁知道如何解决这个问题?
<?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
    android:scaleType="centerCrop"
    android:background="@drawable/frame_top_widget_holo"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:src="@drawable/bigpicture" />

解决方法

android:cropToPadding =“true”解决了这个问题.叹..

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...