Android custom control ratingbar adjust font size

The project needs to make a control that can adjust the font size and change the selected position when sliding or clicking. The effect diagram is as follows:

This is a control similar to ratingbar. However, it is difficult to configure the style of ratingbar to achieve such effects, such as the alignment of the selected pattern with the text above. Therefore, it is necessary to write a custom view to implement it.

The idea is as follows:

The textratingbar class code is as follows:

Several key points:

You don't need custom attributes. When you use them, just put them in the layout and add padding around them.

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>