我已经实现了带有输入项的浮动标签。下面是我的代码和附加的屏幕截图。浮动标签在iphone中运行良好,但在android中,浮动标签在使用react native时触底。
<Item floatingLabel style={styles.floatInput}>
<Label style={styles.lbl}>Enter Your Mobile Number</Label>
<Input
style={styles.inputcolor}
ref="Mobile"
keyboardType="numeric"
onChangeText={text => {
this.checkSetMobile(text)
}}
value={this.state.Mobile}
/>
<Icon style={{color:AppColors.colors.main_color}} name="md-call" />
</Item>
lbl: {
paddingTop: Platform.OS === "ios" ? undefined : 5 ,
paddingBottom: Platform.OS === "ios" ? undefined : 5 ,
marginBottom: 5,
},
inputcolor: {
flex: 1,
paddingBottom:5,
}