React-native: why android Image not support capInsets?

Created on 27 Jan 2016  路  7Comments  路  Source: facebook/react-native

same as title

Locked

Most helpful comment

How are we supposed to use 9-patch images in react-native?

Loading via require('./image.9.png') treats it as a regular image that shows the hints at the edges.

While loading via resources, {uri: 'image'} does load it without the 9patch hints, but it doesn't respect the scaling hints. It just scales it as if it were a regular image without the hints at the edges.

All 7 comments

Hey nowaits, thanks for reporting this issue!

React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.

  • If you don't know how to do something or something is not working as you expect but not sure it's a bug, please ask on StackOverflow with the tag react-native or for more real time interactions, ask on Discord in the #react-native channel.
  • If this is a feature request or a bug that you would like to be fixed, please report it on Product Pains. It has a ranking feature that lets us focus on the most important issues the community is experiencing.
  • We welcome clear issues and PRs that are ready for in-depth discussion. Please provide screenshots where appropriate and always mention the version of React Native you're using. Thank you for your contributions!

@nowaits Use 9-Patch PNGs. That's Android image with capInsets. Natively, Android ImageView doesn't support capInsets on the fly.

How are we supposed to use 9-patch images in react-native?

Loading via require('./image.9.png') treats it as a regular image that shows the hints at the edges.

While loading via resources, {uri: 'image'} does load it without the 9patch hints, but it doesn't respect the scaling hints. It just scales it as if it were a regular image without the hints at the edges.

Is there any news? I can't find user 9-patch image in react-native. :(

I have the same question. I need use 9-patch image in react-native. how i resolve it? @gvaish

I really need it.

Try this npm package:
https://www.npmjs.com/package/react-native-image-capinsets

Support for Android and iOS platforms!

Thank you, madsleejensen

Was this page helpful?
0 / 5 - 0 ratings