瀏覽代碼

[RN] Wrap PagedList navigator with SafeAreaView

j8
Bettenbuk Zoltan 6 年之前
父節點
當前提交
20c1b1cfae

+ 4
- 4
react/features/base/react/components/native/PagedList.js 查看文件

@@ -1,7 +1,7 @@
1 1
 // @flow
2 2
 
3 3
 import React, { Component } from 'react';
4
-import { Text, TouchableOpacity, View } from 'react-native';
4
+import { SafeAreaView, Text, TouchableOpacity, View } from 'react-native';
5 5
 import { connect } from 'react-redux';
6 6
 
7 7
 import { Icon } from '../../../font-icons';
@@ -215,13 +215,13 @@ class PagedList extends Component<Props, State> {
215 215
                 {
216 216
                     this._renderPage(pages[pageIndex], disabled)
217 217
                 }
218
-                <View style = { styles.pageIndicatorContainer }>
218
+                <SafeAreaView style = { styles.pageIndicatorContainer }>
219 219
                     {
220 220
                         pages.map((page, index) => this._renderPageIndicator(
221 221
                             page, index, disabled
222 222
                         ))
223 223
                     }
224
-                </View>
224
+                </SafeAreaView>
225 225
             </View>
226 226
         );
227 227
     }
@@ -247,7 +247,7 @@ class PagedList extends Component<Props, State> {
247 247
                 key = { index }
248 248
                 onPress = { this._onSelectPage(index) }
249 249
                 style = { styles.pageIndicator } >
250
-                <View style = { styles.pageIndicator }>
250
+                <View style = { styles.pageIndicatorContent }>
251 251
                     <Icon
252 252
                         name = { page.icon }
253 253
                         style = { [

+ 9
- 4
react/features/base/react/components/native/styles.js 查看文件

@@ -104,9 +104,9 @@ const PAGED_LIST_STYLES = {
104 104
      */
105 105
     pageIndicator: {
106 106
         alignItems: 'center',
107
-        flex: 1,
108 107
         flexDirection: 'column',
109
-        justifyContent: 'center'
108
+        justifyContent: 'center',
109
+        padding: BoxModel.padding / 2
110 110
     },
111 111
 
112 112
     /**
@@ -120,10 +120,15 @@ const PAGED_LIST_STYLES = {
120 120
      * Container for the page indicators (Android).
121 121
      */
122 122
     pageIndicatorContainer: {
123
-        alignItems: 'stretch',
123
+        alignItems: 'center',
124 124
         backgroundColor: ColorPalette.blue,
125 125
         flexDirection: 'row',
126
-        height: 56,
126
+        justifyContent: 'space-around'
127
+    },
128
+
129
+    pageIndicatorContent: {
130
+        alignItems: 'center',
131
+        flexDirection: 'column',
127 132
         justifyContent: 'center'
128 133
     },
129 134
 

Loading…
取消
儲存