How to make android-wheel horizontal?

前端 未结 3 776
抹茶落季
抹茶落季 2021-01-21 17:05

I\'m trying to take the android-wheel from http://code.google.com/p/android-wheel/ and make it display horizontally. My first attempt to make this happen came from a suggestion

3条回答
  •  自闭症患者
    2021-01-21 17:41

    Did you rotate the appropriate layouts xmls as well? This code sets the background Resources and some of the drawables using xml. I'm betting they're not rotated.

        private void initResourcesIfNecessary() {
        if (centerDrawable == null) {
            centerDrawable = getContext().getResources().getDrawable(R.drawable.wheel_val);
        }
    
        if (topShadow == null) {
            topShadow = new GradientDrawable(Orientation.TOP_BOTTOM, SHADOWS_COLORS);
        }
    
        if (bottomShadow == null) {
            bottomShadow = new GradientDrawable(Orientation.BOTTOM_TOP, SHADOWS_COLORS);
        }
    
        setBackgroundResource(R.drawable.wheel_bg);
    }
    

提交回复
热议问题