Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImageView 9 patch drawable with padding lines not respected

I've got this XML layout. The frame_top_widget_holo is a 9-patch drawable with padding lines on the bottom and right. It also has lines on the top and the left for the stretch bounds. It's set as the background, there's an image drawable set as the source. The result shows both but the src image overlaps the padding set by the drawable. The problem is the scaleType so I suspect this could be a bug. Does anyone have an idea how to fix this?

<?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" />
like image 774
Jeremy Edwards Avatar asked Dec 18 '11 23:12

Jeremy Edwards


1 Answers

android:cropToPadding="true" solves this. Sigh..

like image 127
Jeremy Edwards Avatar answered Nov 05 '22 00:11

Jeremy Edwards