1
私はreact-native
をプログラミングしていて、このhttps://facebook.github.io/react-native/docs/toolbarandroid.htmlを使用してツールバーを作成していますが、私の場合は表示されていません。私は正確に何をしているのか理解できませんでした。ToolbarAndroidが反応しないネイティブで表示されません
誰でも私にこれを手伝ってもらえますか?
import React, { Component } from 'react';
import { AppRegistry, Text, View, TextInput, TouchableOpacity, ToolbarAndroid } from 'react-native';
import { ToolBar } from 'react-native-material-design';
class LoginComponent extends Component {
render() {
return (
<View style={{flex: 1, flexDirection: 'column', margin:10}}>
<ToolbarAndroid title="Login" titleColor="black"/>
<TextInput style={{height: 40, borderColor:'gray', borderWidth: .5}}
placeholder="Email address" underlineColorAndroid='transparent'/>
<TextInput style={{height: 40, borderColor:'gray', borderWidth: .5}}
placeholder="Password" secureTextEntry={true} underlineColorAndroid='transparent'/>
<TouchableOpacity style={{ height: 40, marginTop: 10 , backgroundColor: '#2E8B57'}}>
<Text style={{color: 'white', textAlign: 'center', marginTop: 10, fontWeight: 'bold'}}>LOG IN</Text>
</TouchableOpacity>
</View>
);
}
}
AppRegistry.registerComponent('Myntra',() => LoginComponent);
ありがとうございました。私は高さを設定しましたが、まだ表示されていません。更新されたコードhttp://pastebin.com/XhU17Xe5を参照してください。 –
タイプミスかどうかはわかりませんが、ツールバーのスタイルは 'style = {styles.styles}'に設定されています。私は 'style = {styles.toolbar}'であるべきだと思います。うまくいかない場合、ツールバーの 'height'プロパティを設定しようとしますか? – dvnguyen
はい、うまくいきました!ありがとう –