簡體   English   中英

React Native中的iOS TextInput樣式

[英]iOS TextInput styles in React Native

諸如<Button/><TextInput/>元素在Android上使用默認樣式呈現,但在iOS上它們幾乎沒有樣式。 有沒有辦法在iOS上應用平台樣式(例如邊框和填充)而不用CSS復制它們?

例如

<View style={{flex:1, justifyContent: 'center'}}>
    <Text>Please sign in</Text>
    <TextInput placeholder="Username"/>
    <TextInput placeholder="Password"/>
    <Button onPress={() => {}} title="Sign in"/>
</View>

Android屏幕截圖

iOS螢幕擷取畫面

https://github.com/tombenner/nui

要應用它們,您可以使用platform.select

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM