当文本聚焦时总会有一个蓝色边框。我已经设置了样式borderWidth:0,但是还是有边框。我也尝试过设置边框颜色,也是不行。
有什么提示吗?
没什么特别的,我从 expo 选项卡样板开始。我还发现自动对焦也无法触发:(
import * as React from "react";
import { StyleSheet } from "react-native";
import { TextInput } from "react-native-gesture-handler";
import EditScreenInfo from "../components/EditScreenInfo";
import { Text, View } from "../components/Themed";
export default function TabOneScreen() {
return (
<View style={styles.container}>
<Text style={styles.title}>Tab One</Text>
<View
style={styles.separator}
lightColor="#eee"
darkColor="rgba(255,255,255,0.1)"
/>
<TextInput
autoFocus={true}
placeholder="here is a input"
style={{ padding: 4, borderBottomWidth: 2 }}
/>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: "center",
justifyContent: "center",
},
title: {
fontSize: 20,
fontWeight: "bold",
},
separator: {
marginVertical: 30,
height: 1,
width: "80%",
},
});
Run Code Online (Sandbox Code Playgroud)
您可以尝试将outlineStyle 设置为“none”吗?这将删除所有边框样式
<TextInput style={{outlineStyle: 'none' }} />
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
4701 次 |
最近记录: |