How to make RatingBar to show five stars

前端 未结 18 555
栀梦
栀梦 2020-12-04 18:58

I am following the standard example of how to add a RatingBar. To control the number of stars I tried to use android:numStars=\"5\". The problem is

18条回答
  •  情话喂你
    2020-12-04 19:17

    Another possibility is you are using the Rating in Adapter of list view

    View android.view.LayoutInflater.inflate(int resource, ViewGroup root, boolean attachToRoot)
    

    Below params are necessary for all the attributes to work properly:

    1. Set the root to parent
    2. boolean attachToRoot as false

    Ex: convertView = inflater.inflate(R.layout.myId, parent, false);

提交回复
热议问题