【发布时间】:2017-06-06 06:46:56
【问题描述】:
我正在学习针对 Android 移动应用的 React Native 编程。我正在制作一个屏幕,我需要设置button. 的高度我在view 中添加了button 并设置了使用样式的高度,但是按钮高度没有变化。
/**
* LoginComponent of Myntra
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from "react";
import { AppRegistry, Text, View, Button, TextInput } from "react-native";
class LoginComponent extends Component {
render() {
return (
<View style={{ flex: 1, flexDirection: "column", margin: 10 }}>
<TextInput
style={{
height: 40,
borderColor: "gray",
borderWidth: 0.5
}}
placeholder="Email address"
underlineColorAndroid="transparent"
/>
<TextInput
style={{
height: 40,
borderColor: "gray",
borderWidth: 0.5
}}
placeholder="Password"
secureTextEntry={true}
underlineColorAndroid="transparent"
/>
<View style={{ height: 100, marginTop: 10 }}>
<Button title="LOG IN" color="#2E8B57" />
</View>
</View>
);
}
}
AppRegistry.registerComponent("Myntra", () => LoginComponent);
谁能帮我根据我的要求设置按钮的高度?
【问题讨论】:
标签: android reactjs react-native react-native-android