gpt4 book ai didi

ios - 如何让 XLPagerTabStrip 将选定的选项卡居中?

转载 作者:行者123 更新时间:2023-11-28 15:12:03 25 4
gpt4 key购买 nike

我想要一个有 5 个标签的 viewpager。最大限度。 3 应该一次可见,宽度相等,并且应该使所选选项卡居中。这就像 Fotmob 的应用程序屏幕。

布局应该是这样的:

Yesterday | Live| Today | Tomorrow | Day after Tomorrow

如何使用 XLPagerTabStrip 实现这一点?

最佳答案

settings.style 中的 buttonBarLeftContentInsetbuttonBarRightContentInset 设置为较高的值,这将使所选项目居中。

settings.style.buttonBarLeftContentInset = 9999
settings.style.buttonBarRightContentInset = 9999

遗憾的是,没有简单的方法可以使用 XLPagerTabStrip 设置最大可见性计数。您可以尝试为 settings.style.buttonBarMinimumInteritemSpacing 设置不同的值(考虑屏幕/字体大小)。

关于ios - 如何让 XLPagerTabStrip 将选定的选项卡居中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47473646/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com