mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-22 11:16:06 +08:00
Add support for drawableLeft and drawablePadding props
Summary: Add support inlining images into text inputs. For now this is only available on Android. Reviewed By: andreicoman11 Differential Revision: D3470805 fbshipit-source-id: 14db05ec4d5af549bf314b903654314f39bf73ea
This commit is contained in:
committed by
Facebook Github Bot 8
parent
54ed44628d
commit
eafc5dac62
@@ -412,19 +412,19 @@ exports.examples = [
|
||||
render: function() {
|
||||
return (
|
||||
<View>
|
||||
<TextInput
|
||||
<TextInput
|
||||
style={[styles.singleLine, {fontFamily: 'sans-serif'}]}
|
||||
placeholder="Custom fonts like Sans-Serif are supported"
|
||||
/>
|
||||
<TextInput
|
||||
<TextInput
|
||||
style={[styles.singleLine, {fontFamily: 'sans-serif', fontWeight: 'bold'}]}
|
||||
placeholder="Sans-Serif bold"
|
||||
/>
|
||||
<TextInput
|
||||
<TextInput
|
||||
style={[styles.singleLine, {fontFamily: 'sans-serif', fontStyle: 'italic'}]}
|
||||
placeholder="Sans-Serif italic"
|
||||
/>
|
||||
<TextInput
|
||||
<TextInput
|
||||
style={[styles.singleLine, {fontFamily: 'serif'}]}
|
||||
placeholder="Serif"
|
||||
/>
|
||||
@@ -570,4 +570,28 @@ exports.examples = [
|
||||
return <View>{examples}{types}</View>;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Inline Images',
|
||||
render: function() {
|
||||
return (
|
||||
<View>
|
||||
<TextInput
|
||||
inlineImageLeft="ic_menu_black_24dp"
|
||||
placeholder="This has drawableLeft set"
|
||||
style={styles.singleLine}
|
||||
/>
|
||||
<TextInput
|
||||
inlineImageLeft="ic_menu_black_24dp"
|
||||
inlineImagePadding={30}
|
||||
placeholder="This has drawableLeft and drawablePadding set"
|
||||
style={styles.singleLine}
|
||||
/>
|
||||
<TextInput
|
||||
placeholder="This does not have drawable props set"
|
||||
style={styles.singleLine}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user