ReactNative学习笔记

能够把任意合法的JavaScript表达式经过括号嵌入到JSX语句中html

let pic = {
      uri: 'https://upload.wikimedia.org/wikipedia/commons/d/de/Bananavarieties.jpg'
};

<Image source={pic} style={{top: 100, left: 100, width: 193, height: 110}} />

Image:数组

style的props位置信息有flex

width、height、top、left、right、bottom、minWidth、maxWidth、minHeight、maxHeight、margin、marginVertical、marginHorizontal、marginTop、marginBottom、marginLeft、marginRight、padding、paddingVertical、paddingHorizontal、paddingTop、paddingBottom、paddingLeft、paddingRight、borderWidth、borderWidth、borderTopWidth、borderRightWidth、borderBottomWidth、borderLeftWidth、position、flexDirection、flexWrap、justifyContent、alignItems、alignSelf、flex、flexShrink、flexBasis、zIndex、shadowColor、shadowOffset、shadowOpacity、shadowRadius、transform、transformMatrix、decomposedMatrix、scaleX、scaleY、rotation、translateX、translateY、resizeMode、backfaceVisibility、backgroundColor、borderRadius、overflow、tintColor、opacity、overlayColor、borderTopLeftRadius、borderTopRightRadius、borderBottomLeftRadius、borderBottomRightRadiuscode

样式orm

在数组中位置居后的样式对象比居前的优先级更高,这样你能够间接实现样式的继承htm

<Text style={[styles.red, styles.bigblue]}>red, then bigblue</Text>

组件可以撑满剩余空间的前提是其父容器的尺寸不为零。若是父容器既没有固定的width和height,也没有设定flex,则父容器的尺寸为零。其子组件若是使用了flex,也是没法显示的。对象

相关文章
相关标签/搜索