Android layout with action bar and tabs

前端 未结 3 1961
無奈伤痛
無奈伤痛 2021-01-20 01:22

I\'m new to Android and I need your advice. I would like to have an activity with action bar, I need also tabs (but not tabs in actionbar) and drop down list in action bar t

3条回答
  •  无人共我
    2021-01-20 02:20

    For the action items, if you are using fragments for your different "screens" then they can register to supply action items with setHasOptionsMenu(true); and define their actions by overriding onCreateOptionsMenu(Menu menu, MenuInflater inflater). So, a good rule of design, if you can't explain it simply, you're probably doing something wrong and should change the design.

    It also might be a misuse of Android design to diverge too far from the action bar pattern, meaning you have something that looks like an ActionBar with navigation, but really you have some other thing that you have made up yourself. If this is required, then you should not make something that looks like an action bar with navigation, because users will expect certain behavior and get a different response (confusion).

    Finally, with what you describe, it seems that the Tabs drive the list navigation, yet the list navigation has visual precedence (being above and essentially containing the tabs). So if the tabs are consistent through selections of the list navigation, but the list changes based on selections of the tab navigation, it is represented clearer by having the tabs have visual precedence over the list navigation. So, if you keep both navigation I would reverse their order. Maybe try list navigation with a view pager instead of the list navigation. Jake has a great library for view pager too http://viewpagerindicator.com/

提交回复
热议问题