【发布时间】:2021-02-28 23:06:11
【问题描述】:
我正在尝试从我的layout.xml 设置以下docs 中描述的选项卡属性。
我说的属性是tabIndicatorAnimationModewitch应该有2个选项; linear 和 elastic。如果我在 attrs.xml 文件中的 github 中搜索,我会找到它们:
<attr name="tabIndicatorAnimationMode">
<!-- Animate the selection indicator's left and right bounds in step with
each other. -->
<enum name="linear" value="0"/>
<!-- Animate the selection indicator's left and right bounds out of step
with each other, decelerating the front and accelerating the back.
This causes the indicator to look like it stretches between destinations
an then shrinks back down to fit the size of it's target tab. -->
<enum name="elastic" value="1"/>
</attr>
我是如何实现它的:
<com.google.android.material.tabs.TabLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabIndicatorAnimationMode="elastic">
我使用什么版本的材料设计?(目前最新版本在maven)
implementation 'com.google.android.material:material:1.3.0-alpha03'
我会遇到什么错误?
layout.xml:63: AAPT: error: attribute tabIndicatorAnimationMode not found.
【问题讨论】:
标签: android android-layout material-design android-tablayout android-tabs