使用开源组件

//安装
ohpm install lite_chart
//引用
import { LiteChart } from 'lite_chart'

组件

aspectRatio(m/n)

m/n为宽高比

布局调整

layoutWeight(n)

n为占据的份额。可用于底部,这样底部上方的内容不会把底部挤掉

.margin({})

.padding({})

stateStyles

里面只能使用通用属性

.stateStyles({
normal:{
.width(130)
.height(130)
},
pressed:{
.width((180))
.height(180)
},
disabled:{
.backgroundColor(Color.Green)
},
selected:{
.width(280)
.height(280)
},
focused :{
.width(280)
.height(280)
}
})

.zIndex(n)

在父容器中的层级,n越高层级越高