mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-28 20:25:33 +08:00
Added support for width & height for text images
Summary: public Previously, `<Image>` elements embedded inside `<Text>` ignored all style attributes and props apart from `source`. Now, the `width`, `height` and `resizeMode` styles are observed. I've also added a transparent placeholder to be displayed while the image is loading, to prevent the layout from changing after the image has loaded. Reviewed By: javache Differential Revision: D2838659 fb-gh-sync-id: c27f9685b6976705ac2b24075922b2bf247e06ba
This commit is contained in:
committed by
facebook-github-bot-4
parent
f20453baee
commit
2cbc912756
@@ -213,8 +213,6 @@ static css_dim_t RCTMeasure(void *context, float width, float height)
|
||||
NSTextAttachment *imageAttachment = [NSTextAttachment new];
|
||||
imageAttachment.image = image;
|
||||
[attributedString appendAttributedString:[NSAttributedString attributedStringWithAttachment:imageAttachment]];
|
||||
} else {
|
||||
//TODO: add placeholder image?
|
||||
}
|
||||
} else {
|
||||
RCTLogError(@"<Text> can't have any children except <Text>, <Image> or raw strings");
|
||||
|
||||
Reference in New Issue
Block a user