我用React Native Expo制作了一个应用程序。因此,我对其中一个<View>
应用了边框半径。所以我的问题是,大多数手机在应用程序中显示边框半径,但有些手机将矩形的<View>
显示为原样,它们没有将边框半径显示出来。为什么?
我的代码:
import { StyleSheet, Text, View, ScrollView, TouchableOpacity ,Image, Dimensions} from 'react-native';
import ButtonsCom from '../../components/buttonsCom';
import NavBar2 from '../../components/navBar2';
const animals3=function ({navigation}){
return <View >
<NavBar2 />
<View style={style.styleView456}>
<TouchableOpacity style={{}} activeOpacity={0.8} onPress={()=>{}}>
<View style={style.styleView}>
<View style={style.styleView888}>
<View style={style.styleView8882}>
<Image style={style.imageVio888} source={require('../../../assets/animals/elephant.png')}/>
<Text style={{marginTop:100, marginHorizontal:10 , fontSize:20, fontWeight:"bold"}}>ELEPHANT</Text>
</View>
</View>
</View>
</TouchableOpacity>
<View style={style.styleView}>
<ButtonsCom/> </View>
</View>
</View>
}
let ScreenHeight = Dimensions.get("window").height-90;
const style=StyleSheet.create({
styleView456:{
height:ScreenHeight,
justifyContent:"space-around"
},
styleView:{
flexDirection:"row",
justifyContent:"space-around",
paddingTop:20
},
styleView888:{
borderColor:"#F5F6FA",
width:300,
height:500,
borderRadius:20,
alignItems:"center",
shadowColor:'black',
shadowOffset:{ width: 0, height: 3 },
shadowRadius:6,
elevation:5
},
imageVio888:{
width:270,
height:200,
marginTop:60
},
styleView8882:{
alignItems:"center"
}
});
export default animals3;
因此,我已经将边框半径应用于 style=style.styleView888