文本在ANDROID中显示/显示,但在IOS中不显示。仅显示/显示的图像。
<Block center>
<Block middle>
<Image source={Images.LogoOnboarding} style={styles.logo} />
<Text color="black" size={10} style={{ textAlign: "center", width: 200, position: 'relative'}} >
Take control of what your kids watch on the internet.{"\n"}{"\n"}
Discover kid-friendly channels for your kids.{"\n"}
Choose only the creators that make family- friendly videos.</Text>
<Image source={Images.LogoOnboarding2} style={styles.logo2} />
</Block>
</Block>
这是我的样式代码:
logo: {
width: 100,
height: 100,
zIndex: 2,
position: 'relative',
marginTop: '-50%'
},
logo2: {
width: 400,
height: 40,
zIndex: 2,
position: 'absolute',
resizeMode: 'contain',
marginBottom: 50
}
答案 0 :(得分:0)
function hexToHsl($hex) {
$hex = array($hex[0].$hex[1], $hex[2].$hex[3], $hex[4].$hex[5]);
$rgb = array_map(function($part) {
return hexdec($part) / 255;
}, $hex);
$max = max($rgb);
$min = min($rgb);
$l = ($max + $min) / 2;
if ($max == $min) {
$h = $s = 0;
} else {
$diff = $max - $min;
$s = $l > 0.5 ? $diff / (2 - $max - $min) : $diff / ($max + $min);
switch($max) {
case $rgb[0]:
$h = ($rgb[1] - $rgb[2]) / $diff + ($rgb[1] < $rgb[2] ? 6 : 0);
break;
case $rgb[1]:
$h = ($rgb[2] - $rgb[0]) / $diff + 2;
break;
case $rgb[2]:
$h = ($rgb[0] - $rgb[1]) / $diff + 4;
break;
}
$h /= 6;
}
return array($h, $s, $l);
}
和color
道具都不属于Text组件。考虑使用size
对象的color
和fontSize
属性。我不是100%确定这是iOS上文字不可见的原因,但可能是:)