mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Android textTransform style support (#20572)
Summary: Issue https://github.com/facebook/react-native/issues/2088 (closed, but a bit pre-emptively imo, since Android support was skipped) Related (merged) iOS PR https://github.com/facebook/react-native/pull/18387 Related documentation PR https://github.com/facebook/react-native-website/pull/500 The basic desire is to have a declarative mechanism to transform text content to uppercase or lowercase or titlecase ("capitalized"). Pull Request resolved: https://github.com/facebook/react-native/pull/20572 Differential Revision: D9311716 Pulled By: hramos fbshipit-source-id: dfbb855117196958e7ae5e980700d31be07a448d
This commit is contained in:
committed by
Lorenzo Sciandra
parent
05a036da6d
commit
ef835b52e7
@@ -535,6 +535,56 @@ class TextExample extends React.Component<{}> {
|
||||
make text look slightly misaligned when centered vertically.
|
||||
</Text>
|
||||
</RNTesterBlock>
|
||||
<RNTesterBlock title="Text transform">
|
||||
<Text style={{textTransform: 'uppercase'}}>
|
||||
This text should be uppercased.
|
||||
</Text>
|
||||
<Text style={{textTransform: 'lowercase'}}>
|
||||
This TEXT SHOULD be lowercased.
|
||||
</Text>
|
||||
<Text style={{textTransform: 'capitalize'}}>
|
||||
This text should be CAPITALIZED.
|
||||
</Text>
|
||||
<Text style={{textTransform: 'capitalize'}}>
|
||||
Mixed: <Text style={{textTransform: 'uppercase'}}>uppercase </Text>
|
||||
<Text style={{textTransform: 'lowercase'}}>LoWeRcAsE </Text>
|
||||
<Text style={{textTransform: 'capitalize'}}>
|
||||
capitalize each word
|
||||
</Text>
|
||||
</Text>
|
||||
<Text>
|
||||
Should be "ABC":
|
||||
<Text style={{textTransform: 'uppercase'}}>
|
||||
a<Text>b</Text>c
|
||||
</Text>
|
||||
</Text>
|
||||
<Text>
|
||||
Should be "AbC":
|
||||
<Text style={{textTransform: 'uppercase'}}>
|
||||
a<Text style={{textTransform: 'none'}}>b</Text>c
|
||||
</Text>
|
||||
</Text>
|
||||
<Text style={{textTransform: 'none'}}>
|
||||
{
|
||||
'.aa\tbb\t\tcc dd EE \r\nZZ I like to eat apples. \n中文éé 我喜欢吃苹果。awdawd '
|
||||
}
|
||||
</Text>
|
||||
<Text style={{textTransform: 'uppercase'}}>
|
||||
{
|
||||
'.aa\tbb\t\tcc dd EE \r\nZZ I like to eat apples. \n中文éé 我喜欢吃苹果。awdawd '
|
||||
}
|
||||
</Text>
|
||||
<Text style={{textTransform: 'lowercase'}}>
|
||||
{
|
||||
'.aa\tbb\t\tcc dd EE \r\nZZ I like to eat apples. \n中文éé 我喜欢吃苹果。awdawd '
|
||||
}
|
||||
</Text>
|
||||
<Text style={{textTransform: 'capitalize'}}>
|
||||
{
|
||||
'.aa\tbb\t\tcc dd EE \r\nZZ I like to eat apples. \n中文éé 我喜欢吃苹果。awdawd '
|
||||
}
|
||||
</Text>
|
||||
</RNTesterBlock>
|
||||
</RNTesterPage>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user