0
私は単純なログイン画面を構築しようとしています。しかし、私が中心にコンテンツを正当化しようとすると、要素が上下にジャンプを停止しません。 。 flexまたはjustifyContent属性を削除すると、ジャンプが停止します。この反応するネイティブのコンテンツセンターが原因で、アンドロイド上でアイテムがジャンプする
export default class LoginScreen extends React.Component {
render() {
return (
<View style={Styles.container} >
<Text>Hello world</Text>
</View>
)}
let Styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: 'column',
// padding: 15,
// backgroundColor: 'red',
justifyContent: 'center',
alignItems: 'center',
},
)
マイApp.jsは自分のアプリケーションでこの問題を解決しようとした後、私は唯一の解決策があるとの点に来ている。この
import { Platform } from 'react-native';
import { Navigation } from 'react-native-navigation';
import registerScreens from './app/Screens';
import {
AppRegistry,
Text,
} from 'react-native';
registerScreens();
let tabs = [
{
label: 'Login',
screen: 'tasks.LoginScreen', // this is a registered name for a screen
icon: require('./assets/account_circle.png'),
// selectedIcon: require('../img/one_selected.png'), // iOS only
title: 'Hello world'
},
{
label: 'Two',
screen: 'tasks.CreateUserScreen',
icon: require('./assets/account_circle.png'),
// selectedIcon: require('../img/two_selected.png'), // iOS only
title: 'Screen Two'
}
]
Navigation.startTabBasedApp({
tabs,
animationType: Platform.OS === 'ios' ? 'slide-down' : 'fade',
tabsStyle: {
tabBarBackgroundColor: '#003a66',
tabBarButtonColor: '#ffffff',
tabBarSelectedButtonColor: '#ff505c',
tabFontFamily: 'BioRhyme-Bold',
},
appStyle: {
tabBarBackgroundColor: '#003a66',
navBarButtonColor: '#ffffff',
tabBarButtonColor: '#ffffff',
navBarTextColor: '#ffffff',
tabBarSelectedButtonColor: '#ff505c',
navigationBarColor: '#003a66',
navBarBackgroundColor: '#003a66',
statusBarColor: '#002b4c',
tabFontFamily: 'BioRhyme-Bold',
},
drawer: {
left: {
screen: 'tasks.LoginScreen'
}
}
});
ログイン画面でジャンプのスクリーンショットまたはgifを提供できますか?あなたのログイン画面のコードに間違いはありません。 –
私はまったく同じ問題を経験しています。問題のGIFがあります。 https://i.gyazo.com/644cb6c6c309ce83ca7dae881f6342f1.gif –