开发者

Android WheelView is all black?

So I found this really nice WheelView here that has been mentioned here before. I tried using it but I hit a few problems, and don't know what am I doing wrong. So what I did is link the src folder like it has been done in WheelView-demo app. It didn't work then, but to make it work I had to link a gen folder also and copy layout_bg.xml over to my res->layout folder from the demo app.

After that I created my two arrays of data that will be shown (text) and when I run it I get this. image

For backg开发者_开发问答round of both wheels it uses my icon.png files, and I just want it to be white as it is in the original app. Also the selection bar is not transparent so I can not see the selection.

Any ideas what to do? Thanks for the help.


Ok, I fixed it, but I think it might not be the right solution :) So there is a file called layout_bg.xml whre the bar with the selected value is defined, colours wise. These are the contents:

<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <gradient
        android:startColor="#FF000000"
        android:centerColor="#FF000000"
        android:endColor="#FF777777"
    android:angle="90" />
</shape>

So to fix it I replaced centerColor="#FF000000" with centerColor="#00FFFFFF". You could write all zeros, but this way it looks nicer. Anyway what is still puzzling me is that in the android reference, it says that first two digits represent Alpha channel, FF being opaque and 00 being transparent, but I am not sure that this kind of mistake would be in this code that I downloaded?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜