mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Updates from Wed 24 Jun
This commit is contained in:
@@ -88,9 +88,11 @@ var styles = StyleSheet.create({
|
||||
justifyContent: 'center',
|
||||
},
|
||||
sizeSmall: {
|
||||
width: 20,
|
||||
height: 20,
|
||||
},
|
||||
sizeLarge: {
|
||||
width: 36,
|
||||
height: 36,
|
||||
}
|
||||
});
|
||||
|
||||
@@ -42,6 +42,14 @@ var INNERVIEW = 'InnerScrollView';
|
||||
* Component that wraps platform ScrollView while providing
|
||||
* integration with touch locking "responder" system.
|
||||
*
|
||||
* Keep in mind that ScrollViews must have a bounded height in order to work,
|
||||
* since they contain unbounded-height children into a bounded container (via
|
||||
* a scroll interaction). In order to bound the height of a ScrollView, either
|
||||
* set the height of the view directly (discouraged) or make sure all parent
|
||||
* views have bounded height. Forgetting to transfer `{flex: 1}` down the
|
||||
* view stack can lead to errors here, which the element inspector makes
|
||||
* easy to debug.
|
||||
*
|
||||
* Doesn't yet support other contained responders from blocking this scroll
|
||||
* view from becoming the responder.
|
||||
*/
|
||||
|
||||
@@ -44,12 +44,15 @@ var AndroidTextInputAttributes = {
|
||||
autoCapitalize: true,
|
||||
autoCorrect: true,
|
||||
autoFocus: true,
|
||||
textAlign: true,
|
||||
textAlignVertical: true,
|
||||
keyboardType: true,
|
||||
multiline: true,
|
||||
password: true,
|
||||
placeholder: true,
|
||||
text: true,
|
||||
testID: true,
|
||||
underlineColorAndroid: true,
|
||||
};
|
||||
|
||||
var viewConfigAndroid = {
|
||||
@@ -68,8 +71,8 @@ type Event = Object;
|
||||
|
||||
/**
|
||||
* A foundational component for inputting text into the app via a
|
||||
* keyboard. Props provide configurability for several features, such as auto-
|
||||
* correction, auto-capitalization, placeholder text, and different keyboard
|
||||
* keyboard. Props provide configurability for several features, such as
|
||||
* auto-correction, auto-capitalization, placeholder text, and different keyboard
|
||||
* types, such as a numeric keypad.
|
||||
*
|
||||
* The simplest use case is to plop down a `TextInput` and subscribe to the
|
||||
@@ -123,6 +126,19 @@ var TextInput = React.createClass({
|
||||
* If true, focuses the input on componentDidMount. Default value is false.
|
||||
*/
|
||||
autoFocus: PropTypes.bool,
|
||||
/**
|
||||
* Set the position of the cursor from where editing will begin.
|
||||
*/
|
||||
textAlign: PropTypes.oneOf([
|
||||
'start',
|
||||
'center',
|
||||
'end',
|
||||
]),
|
||||
textAlignVertical: PropTypes.oneOf([
|
||||
'top',
|
||||
'center',
|
||||
'bottom',
|
||||
]),
|
||||
/**
|
||||
* If false, text is not editable. Default value is true.
|
||||
*/
|
||||
@@ -260,6 +276,10 @@ var TextInput = React.createClass({
|
||||
* Used to locate this view in end-to-end tests.
|
||||
*/
|
||||
testID: PropTypes.string,
|
||||
/**
|
||||
* The color of the textInput underline. Is only supported on Android.
|
||||
*/
|
||||
underlineColorAndroid: PropTypes.string,
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -461,6 +481,10 @@ var TextInput = React.createClass({
|
||||
|
||||
_renderAndroid: function() {
|
||||
var autoCapitalize = RCTUIManager.UIText.AutocapitalizationType[this.props.autoCapitalize];
|
||||
var textAlign =
|
||||
RCTUIManager.AndroidTextInput.Constants.TextAlign[this.props.textAlign];
|
||||
var textAlignVertical =
|
||||
RCTUIManager.AndroidTextInput.Constants.TextAlignVertical[this.props.textAlignVertical];
|
||||
var children = this.props.children;
|
||||
var childCount = 0;
|
||||
ReactChildren.forEach(children, () => ++childCount);
|
||||
@@ -477,6 +501,8 @@ var TextInput = React.createClass({
|
||||
style={[this.props.style]}
|
||||
autoCapitalize={autoCapitalize}
|
||||
autoCorrect={this.props.autoCorrect}
|
||||
textAlign={textAlign}
|
||||
textAlignVertical={textAlignVertical}
|
||||
keyboardType={this.props.keyboardType}
|
||||
multiline={this.props.multiline}
|
||||
onFocus={this._onFocus}
|
||||
@@ -489,6 +515,7 @@ var TextInput = React.createClass({
|
||||
password={this.props.password || this.props.secureTextEntry}
|
||||
placeholder={this.props.placeholder}
|
||||
text={this.state.bufferedValue}
|
||||
underlineColorAndroid={this.props.underlineColorAndroid}
|
||||
children={children}
|
||||
/>;
|
||||
|
||||
|
||||
@@ -95,6 +95,11 @@ var WebView = React.createClass({
|
||||
* Used for android only, JS is enabled by default for WebView on iOS
|
||||
*/
|
||||
javaScriptEnabledAndroid: PropTypes.bool,
|
||||
/**
|
||||
* Used for iOS only, sets whether the webpage scales to fit the view and the
|
||||
* user can change the scale
|
||||
*/
|
||||
scalesPageToFit: PropTypes.bool,
|
||||
},
|
||||
|
||||
getInitialState: function() {
|
||||
@@ -155,6 +160,7 @@ var WebView = React.createClass({
|
||||
onLoadingStart={this.onLoadingStart}
|
||||
onLoadingFinish={this.onLoadingFinish}
|
||||
onLoadingError={this.onLoadingError}
|
||||
scalesPageToFit={this.props.scalesPageToFit}
|
||||
/>;
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user