We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
yoga3 ios scroller 在没有滚动轴 尺寸时,android 默认无法超出父容器,ios 为内容大小 原因为:Fix measure inner dimensions
ios 为 scroller 和子视图相同大小,并在 parent view 中居中显示 android 为 scroller parent view 大小一致
和 ios 保持一致(与web一致)
class RootView extends View { constructor() { super(); this.style = { width: '100%', height: '100%', alignItems: 'center', justifyContent: 'center' } this.initElement() }
initElement(){ const view = new View() view.style = { justifyContent : "flex-start", alignItems : "center", display : "flex", flexDirection :"column", width : '100%', marginTop : "15", } this.appendChild(view);
const scroller = new HorizontalScroller() scroller.style = { flexShrink : 0, } for (let index = 0; index < 7; index++) { const item = this.createItem(index); scroller.appendChild(item); } view.appendChild(scroller)
}
createItem(message:number) : View{
const item = new View() // item.style = { // width : 700, // height : 100, // } item.style = { height : "100%", display : "flex", marginTop : "15", width : 60, alignItems : "center", marginLeft : 12.5, flexDirection : "column", justifyContent : "flex-start", marginRight : 0 } var text = new Text() text.style = { fontSize: 20, height:100 } text.text = message + '' item.appendChild(text); return item
} }
// 根页面渲染 Hummer.render(new RootView());
截图:
The text was updated successfully, but these errors were encountered:
bbssyyuui
yFeii
No branches or pull requests
描述
yoga3 ios scroller 在没有滚动轴 尺寸时,android 默认无法超出父容器,ios 为内容大小
原因为:Fix measure inner dimensions
Hummer version:
复现步骤
ios 为 scroller 和子视图相同大小,并在 parent view 中居中显示
android 为 scroller parent view 大小一致
预期结果
和 ios 保持一致(与web一致)
样例代码、屏幕截图或者仓库链接
class RootView extends View {
constructor() {
super();
this.style = {
width: '100%',
height: '100%',
alignItems: 'center',
justifyContent: 'center'
}
this.initElement()
}
initElement(){
const view = new View()
view.style = {
justifyContent : "flex-start",
alignItems : "center",
display : "flex",
flexDirection :"column",
width : '100%',
marginTop : "15",
}
this.appendChild(view);
}
createItem(message:number) : View{
}
}
// 根页面渲染
Hummer.render(new RootView());
截图:
The text was updated successfully, but these errors were encountered: