java - android底部导航栏用RadioGroup+RadioButton,但是气泡功能怎么实现呢?
伊谢尔伦
伊谢尔伦 2017-04-17 16:42:09
0
6
803
伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(6)
阿神

When you implement the Tab label yourself, you have to manually change the state of the View when switching so that the View can display the effect of the corresponding state. Have you set that label to selected here?

PHPzhong

When I made this bottom navigation, I used FragmentTabHost and it felt good.
As for the bubble function, there should be many open source ones

阿神

Selector should be used to select the color change, which means that the selection can be setview状态为actived

大家讲道理

I set the tab background to a customized itemtrue.xml,

android:background="@drawable/itemtrue"

Then set the state in itemtrue.xml, where state includes state_pressed, state_checked, and state_enabled. You can see what kind of effect you want.

<item
        android:drawable="@drawable/darkgreen"
        android:state_pressed="true" />

The effect is as follows:

刘奇

Customize your RadioButton and use canvas to draw your bubbles (shape outlines and numbers) in the onDraw method. The other is to use framelayout as your unit button. The bubble placeholder is hidden and notifications are displayed (different numbers are displayed in conjunction with the cut picture)

Ty80

Recommended to use BadgeView

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!