[英]<Input /> and <Textarea /> are not aligned in native-base, React Native
我想使用原生基礎將單行輸入和多行輸入放入表單中,但它們未正確對齊垂直線。 有什么我遺漏的或者不應該一起使用的嗎? 謝謝你。
package.json 的一部分
"expo": "~37.0.3",
"native-base": "2.13.8",
"react": "~16.9.0",
"react-dom": "~16.9.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz",
我的代碼
<Content padder>
<Form>
<Item regular floatingLabel>
<Label style={{paddingTop: 2}}>Label</Label>
<Input onChangeText={url => setUrl(url)}/>
</Item>
<Textarea
rowSpan={5}
onChangeText={content => setContent(content)}
bordered
placeholder="this is textarea"
/>
</Form>
</Content>
========已編輯
我找到了答案,只需將 floatingLabel 替換為常規。 但是,占位符仍未對齊。
<Item regular>
<Label>URL</Label>
<Input onChangeText={url => setUrl(url)}/>
</Item>
您必須在 textarea 的樣式中設置填充。
<Textarea style={{paddingLeft: over9000}}... />
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.