ImageView 9 patch drawable with padding lines not respected
Asked Answered
G

1

7

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" />
Gnawing answered 18/12, 2011 at 23:43 Comment(0)
G
13

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

Gnawing answered 19/12, 2011 at 0:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.