我尝试在我的项目中使用shoutem/ui!我为登录/注册创建了一个组件,它在 iOS 中运行良好,但在 android 上我遇到了如下图所示的问题,这是我的代码:
<Screen
style={{
backgroundColor: '#2ecc71'
}}
>
<StatusBar
barStyle="light-content"
/>
<NavigationBar
styleName="no-border"
style={{
container: {
position: 'relative',
width: Dimensions.get('window').width,
backgroundColor: '#2ecc71'
}
}}
/>
<View
style={{
alignItems: 'center',
flexGrow: 1,
justifyContent: 'center',
}}
>
<Divider />
<Image
styleName="medium-square"
source={require('../images/logo.png')}
/>
{this.renderSpinner()}
<Divider />
<TextInput
placeholder={'Username or email'}
editable={!this.state.statusButton}
onChangeText={(text) => this.setState({ email: text })}
keyboardType="email-address"
autoCapitalize="none"
autoCorrect={false}
/>
<Divider styleName="line" />
<TextInput
editable={!this.state.statusButton}
onChangeText={(text) => this.setState({ password: text })}
placeholder={'Password'}
secureTextEntry
autoCapitalize="none"
/>
<Divider />
<View styleName="horizontal flexible">
<Button
disabled={this.state.statusButton}
styleName="full-width confirmation"
onPress={this.onLoginPressed.bind(this)}
>
<Text>LOGIN</Text>
</Button>
<Button
disabled={this.state.statusButton}
styleName="full-width confirmation"
onPress={this.goToRegister.bind(this)}
>
<Text>REGISTER</Text>
</Button>
</View>
</View>
</Screen>