mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-30 10:16:42 +08:00
line break mode for ios
Summary: What do you think is ```lineBreakMode``` a good name? For android it is called ```ellipsize```. <img src="https://cloud.githubusercontent.com/assets/1488195/15628555/7372f8d0-250c-11e6-8919-722f28a38d60.png"" width="300" /> Closes https://github.com/facebook/react-native/pull/7819 Differential Revision: D3417256 fbshipit-source-id: 189441a23ff554bf7f6d67fa8510959351e9e5cc
This commit is contained in:
committed by
Facebook Github Bot 3
parent
33dfc9db92
commit
c03b166854
@@ -29,6 +29,7 @@ const viewConfig = {
|
||||
validAttributes: merge(ReactNativeViewAttributes.UIView, {
|
||||
isHighlighted: true,
|
||||
numberOfLines: true,
|
||||
lineBreakMode: true,
|
||||
allowFontScaling: true,
|
||||
}),
|
||||
uiViewClassName: 'RCTText',
|
||||
@@ -69,6 +70,11 @@ const viewConfig = {
|
||||
|
||||
const Text = React.createClass({
|
||||
propTypes: {
|
||||
/**
|
||||
* Line Break mode. Works only with numberOfLines.
|
||||
* clip is working only for iOS
|
||||
*/
|
||||
lineBreakMode: React.PropTypes.oneOf(['head', 'middle', 'tail', 'clip']),
|
||||
/**
|
||||
* Used to truncate the text with an ellipsis after computing the text
|
||||
* layout, including line wrapping, such that the total number of lines
|
||||
@@ -110,6 +116,7 @@ const Text = React.createClass({
|
||||
return {
|
||||
accessible: true,
|
||||
allowFontScaling: true,
|
||||
lineBreakMode: 'tail',
|
||||
};
|
||||
},
|
||||
getInitialState: function(): Object {
|
||||
|
||||
Reference in New Issue
Block a user