Home  >  Q&A  >  body text

java - android底部导航栏用RadioGroup+RadioButton,但是气泡功能怎么实现呢?

伊谢尔伦伊谢尔伦2766 days ago840

reply all(6)I'll reply

  • 阿神

    阿神2017-04-17 16:44:09

    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?

    reply
    0
  • PHPz

    PHPz2017-04-17 16:44:09

    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

    reply
    0
  • 阿神

    阿神2017-04-17 16:44:09

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

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-17 16:44:09

    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:

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 16:44:09

    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)

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 16:44:09

    Recommended to use BadgeView

    reply
    0
  • Cancelreply