升级yoga3(yoga2)后,scroller 在不设置size 时,两端大小表现不一致
@yFeii is already working on this.
Since Jul 16, 2024.
Assessment
This issue has not been assessed yet.
Description
描述
yoga3 ios scroller 在没有滚动轴 尺寸时,android 默认无法超出父容器,ios 为内容大小
原因为:Fix measure inner dimensions
Hummer version:
复现步骤
- 创建 parent view 设置 主轴交叉轴对其为 center,设置 width 300,height 100
- 创建scroller 不设置任何样式
- 给 scroller 添加 子视图,并使子视图 size 超过300
- 运行
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());
截图:
- Dominant language
- Objective-C
- Stars
- 1.4k
- Forks
- 186
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from didi/Hummer
-
支持svg图吗?Openenhancement Needs: Triage 🔍
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
T i t li leOpenbug Needs: Triage 🔍
Difficulty 5/5 Over a week Newbie friendliness 1/100
-
bug Needs: Triage 🔍
Difficulty 4/5 3-5 days Newbie friendliness 20/100
-
bug Needs: Triage 🔍
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
hummer会导致全app的网页无法打开Openbug Needs: Triage 🔍
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Similar issues
-
A heading containing `$` or `\` is mangled in the table of contentsPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
schuyler/macdown3000#693 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
yetanotherbrowser/yab#1062 ·
Maintainers usually reply within 1 day
-
Peek: the card's top-bar buttons can miss a press while the card is pinchedPossibly taken @mjkang-estrella claimed this 2 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
ardia-browser/ardia#3087 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
darlinghq/darling#2335 · 1 comment ·
Maintainers usually reply within 1 day
-
Cocoa
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
getsentry/sentry-cocoa#9693 · 1 comment ·
Maintainers usually reply within 1 day