mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-05 17:30:38 +08:00
Add selectionColor prop for Text on Android
Summary: **Motivation** Customizing the selection color allows to use brand colors in the app. The PR implements a `selectionColor` prop for `Text` component similar to `TextInput`. **Test plan (required)** Run UIExplorer example with the changes and verify everything works fine.  cc brentvatne Closes https://github.com/facebook/react-native/pull/11947 Differential Revision: D4430265 fbshipit-source-id: 462f16548d93ab03aadb27d6f12acf90842627ab
This commit is contained in:
committed by
Facebook Github Bot
parent
81c33b542d
commit
72be2d35cc
@@ -386,10 +386,15 @@ class TextExample extends React.Component {
|
||||
</Text>
|
||||
</UIExplorerBlock>
|
||||
<UIExplorerBlock title="selectable attribute">
|
||||
<Text selectable={true}>
|
||||
<Text selectable>
|
||||
This text is selectable if you click-and-hold, and will offer the native Android selection menus.
|
||||
</Text>
|
||||
</UIExplorerBlock>
|
||||
<UIExplorerBlock title="selectionColor attribute">
|
||||
<Text selectable selectionColor="orange">
|
||||
This text will have a orange highlight on selection.
|
||||
</Text>
|
||||
</UIExplorerBlock>
|
||||
<UIExplorerBlock title="Inline images">
|
||||
<Text>
|
||||
This text contains an inline image <Image source={require('./flux.png')}/>. Neat, huh?
|
||||
|
||||
Reference in New Issue
Block a user