gpt4 book ai didi

android-spinnerwheel - 可绘制的单个选项卡

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:15:20 26 4
gpt4 key购买 nike

我想在 WheelHorizo​​ntalView(包含在库 android-spinnerwheel 中)中设置单独的选项卡宽度和高度。并将该选项卡设置为支持选择/按下状态的可绘制对象。

这可以在 ViewPagerIndicator 中完成(使用 vpiTabPageIndicatorStyle),但我不能使用这个库来完成。 (这就是我使用 vpiTabPageIndicatorStyle 完成的方式:http://pastebin.com/wB4vGMyJ)

我尝试的是将 selectionDivider 更改为这个 drawable:

<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/drawable_daychooser_item_pressed" />
<item android:state_selected="true" android:drawable="@drawable/drawable_daychooser_item_selected" />
<item android:drawable="@drawable/drawable_daychooser_item_default" />
</selector>

但这行不通。我查看了 wheel__attrs.xml 但我找不到另一个格式为可绘制对象的属性(引用)。

现在是这样的:

before

这就是我想要的:

after

如果您想知道为什么我从 ViewPagerIndicator 切换到 android-spinnerwheel看这里:ViewPagerIndicator - Set the TabPageIndicator to the center

我也在 android-spinnerwheel 上问过这个问题GitHub 页面,但 4 个月后没有任何回复我决定也在这里提问。

最佳答案

我通过简单地更改了 WheelAdapter 中的文本颜色-

        @Override
public View getItem(int index, View cachedView, ViewGroup parent) {
View view = super.getItem(index, cachedView, parent);
((TextView)view.findViewById(R.id.textView)).setTextColor(index==minute?Color.WHITE:Color.BLACK);
return view;
}

关于android-spinnerwheel - 可绘制的单个选项卡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23139865/

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