How to expand navigation list in action bar?

后端 未结 2 466
长情又很酷
长情又很酷 2021-02-02 02:09

In android you could set a navigation list in action bar by passing spinner adapter and OnNavigationListener. the issue is that the navigation list dont fill most of the action

2条回答
  •  南旧
    南旧 (楼主)
    2021-02-02 03:11

    You want to implement the getDropDownView method too. This lets you supply a different view for the dropdown list with the metrics and formatting you want.

    Consider inflating the framework layouts android.R.layout.simple_spinner_item and android.R.layout.simple_spinner_dropdown_item for these situations. Use findViewById(android.R.id.text1) to get the TextView you should fill out in each one.

提交回复
热议问题