- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我想在 WheelHorizontalView(包含在库 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
但我找不到另一个格式为可绘制对象的属性(引用)。
现在是这样的:
这就是我想要的:
如果您想知道为什么我从 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/
我想在 WheelHorizontalView(包含在库 android-spinnerwheel 中)中设置单独的选项卡宽度和高度。并将该选项卡设置为支持选择/按下状态的可绘制对象。 这可以在
我正在构建一个同时使用 android-spinnerwheel 和 cardsLib 库的应用程序。SpinnerWheel 工作得很好,但是当我尝试使用滑动来删除 cardsLib 的功能时,sp
我是一名优秀的程序员,十分优秀!