gpt4 book ai didi

android - 如何将可滚动选项卡与 Android 中的键线对齐

转载 作者:太空狗 更新时间:2023-10-29 16:33:50 25 4
gpt4 key购买 nike

我正在使用 TabLayout 来实现可滚动的选项卡。在material design guildline( https://www.google.com/design/spec/components/tabs.html#tabs-specs )中提示“最左边的tab content aligns with the keyline”,图片: enter image description here

我尝试添加一个属性 paddingLeft,但它不对。那么,正如指南所述,我该怎么做才能实现它?请帮忙!

最佳答案

在 TabLayout xml 文件中使用 app:tabContentStart="60dp"。因为指南指出屏幕左边缘到第一个选项卡标题开始的位置之间有 72dp,并且因为所有选项卡标题都是左右填充 12dp,所以您需要 60dp。例如:

    <android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent" android:layout_height="wrap_content"
app:tabContentStart="60dp"
app:tabMode="scrollable"
app:tabGravity="center"/>

关于android - 如何将可滚动选项卡与 Android 中的键线对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33079136/

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