Kurosawa Hiroyuki
Kurosawa Hiroyuki

Reputation: 1267

Android How to specity 9patch corner radius in dp?

I'm trying to use 9patch on Android app, overall screen layout is in dp unit so the 9-patch UI parts' size(Like button width) also.

It seems like that when building UI in dp unit, only a 9-patch corner size should be defined in pixel unit (means I cannot specify corner parts' size at all - the original pixel is used) and it's difficult to control the corner radius of that 9patch.

Is there a way to define a corner radius of a 9patch in dp unit or good workaround to control the corner size of it?

Upvotes: 1

Views: 1345

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007296

Nine-patch drawables do not have a corner radius. You control how they are stretched via the rules embedded in the 1px wide border.

Upvotes: 1

Related Questions