非常教程

React native参考手册

指南(IOS) | Guides (iOS)

App Extensions

附加应用信息可让您在主应用以外提供自定义功能和内容。iOS上有不同类型的应用程序扩展,全部都在App Extension编程指南中介绍。在本指南中,我们将简要介绍如何利用iOS上的附加应用信息。

内存在扩展中使用

由于这些扩展程序是在常规应用程序沙箱之外加载的,因此很可能会同时加载其中几个应用程序扩展程序。正如您所预料的那样,这些扩展具有较小的内存使用限制。开发附加应用信息时请记住这些。总是强烈建议在实际设备上测试您的应用程序,在开发应用程序扩展时更是如此:开发者经常发现,他们的扩展在iOS模拟器中工作得很好,只是为了获得用户报告,他们的扩展没有实际加载设备。

我们强烈建议您观看Conrad Kramer关于扩展中内存使用的讨论,以了解有关此主题的更多信息。

今日小部件

Today小部件的内存限制为16 MB。碰巧,使用React Native的Today小部件实现可能不可靠,因为内存使用率往往太高。如果您的Today小部件产生消息'Unable to Load',您可以判断它是否超出内存限制:

App Extensions

始终确保在真实设备中测试您的附加应用信息,但请注意,这可能不够,特别是在处理“今日”小部件时。调试配置的构建更有可能超出内存限制,而发布配置的构建不会立即失败。我们强烈建议您使用Xcode的乐器来分析您的真实世界的内存使用情况,因为您的发布配置版本很可能非常接近16 MB的限制。在这样的情况下,通过执行常见操作(例如从API获取数据)很容易超过16 MB的限制。

要尝试React Native Today窗口小部件实现的限制,请尝试在react-native-today-widget中扩展示例项目。

其他附加应用信息

其他类型的应用扩展程序的内存限制比“今日”小部件更大。例如,自定义键盘扩展名被限制为48 MB,共享扩展名被限制为120 MB。使用React Native实施此类附加应用程序更具可行性。概念示例的一个证明是react-native-ios-share-extension。

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