非常教程

React native参考手册

Components: TouchableHighlight

TouchableHighlight

用于使视图正确响应触摸的包装器。在按下时,包装视图的不透明度会降低,从而允许底色显示,遮蔽或调色。

底层来自将新子视图包装进来的新视图,这会影响布局,并且如果使用不正确,有时会导致不需要的视觉工件,例如,如果包装视图的backgroundColor未明确设置为不透明颜色。

TouchableHighlight必须有一个孩子(不是零或多于一个)。如果您希望有多个子组件,请将它们包装在View中。

例:

renderButton: function() {
  return (
    <TouchableHighlight onPress={this._onPressButton}>
      <Image
        style={styles.button}
        source={require('./myButton.png')}
      />
    </TouchableHighlight>
  );
},

道具

TouchableWithoutFeedback props...

activeOpacity?: number

确定触摸处于活动状态时,包装视图的不透明度应为何值。

onHideUnderlay?: function

隐藏衬垫后立即调用

onShowUnderlay?: function

显示衬底后立即调用

style?: ViewPropTypes.style

underlayColor?: color

触摸处于活动状态时将显示的衬底颜色。

ioshasTVPreferredFocus?: bool

(仅限Apple TV)电视首选焦点(请参阅查看组件的文档)。

iostvParallaxProperties?: object

(仅适用于Apple TV)具有控制Apple TV视差效果属性的对象。

启用:如果为true,则启用视差效果。默认为true。shiftDistanceX:默认为2.0。shiftDistanceY:默认为2.0。tiltAngle:默认为0.05。放大倍数:默认为1.0。

Components: TouchableHighlight相关

React native

React Native 是一个 JavaScript 的框架,用来撰写实时的、可原生呈现 iOS 和 Android 的应用。

主页 https://facebook.github.io/react-native/
源码 https://github.com/facebook/react-native
发布版本 0.49

React native目录

1.开始 | Getting Started
2.指南 | Guides
3.APIs
4.组件:ActivityIndicator | Components: ActivityIndicator
5.组件:按钮 | Components: Button
6.组件:CheckBox | Components: CheckBox
7.组件:DatePickerIOS | Components: DatePickerIOS
8.组件:DrawerLayoutAndroid | Components: DrawerLayoutAndroid
9.组件:FlatList | Components: FlatList
10.组件:图像 | Components: Image
11.组件:KeyboardAvoidingView | Components: KeyboardAvoidingView
12.Components: ListView
13.Components: MaskedViewIOS
14.Components: Modal
15.Components: NavigatorIOS
16.Components: Picker
17.Components: PickerIOS
18.Components: ProgressBarAndroid
19.Components: ProgressViewIOS
20.Components: RefreshControl
21.Components: ScrollView
22.Components: SectionList
23.Components: SegmentedControlIOS
24.Components: Slider
25.Components: SnapshotViewIOS
26.Components: StatusBar
27.Components: Switch
28.Components: TabBarIOS
29.Components: TabBarIOS.Item
30.Components: Text
31.Components: TextInput
32.Components: ToolbarAndroid
33.Components: TouchableHighlight
34.Components: TouchableNativeFeedback
35.Components: TouchableOpacity
36.Components: TouchableWithoutFeedback
37.Components: View
38.Components: ViewPagerAndroid
39.Components: VirtualizedList
40.Components: WebView
41.创建 | Contributing
42.指南(Android) | Guides (Android)
43.指南(IOS) | Guides (iOS)
44.其他 | Miscellaneous