动作条setnavigationmode德precated [英] actionbar setnavigationmode deprecated
问题描述
您好我正在做一个应用程序中,我计划显示地板和放大器;卖场内的商场类明智上市。
Hi I'm making an app in which I plan on showing floor & category wise listing of stores inside a mall.
下面单元显示出商店的地板明智的上市活动
Below snap show an activity showing floor wise listing of stores
我在想和类别,并称在动作条微调框显示按层作为选项。单击类别将根据其所属类别中安排的商店。 google搜索了一下后,我发现
I was thinking of adding a spinner in the ActionBar showing "by Floor" and "by Category" as options. Clicking on "by Category" would arrange the stores according to the category in which they belong. After googling a bit I found
getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
将是容易,但现在我看到它去precated,把它作为一个行动项目中的活动菜单看起来并不像一个很好的主意。有什么建议?
would be apt but now I see that its deprecated, putting it as an action item in the activity menu doesn't look like a very good idea. Any suggestions ?
推荐答案
setNavigationMode它是在棒棒糖,因为pcated德$ P $它已经被替换为一个新的范例。
setNavigationMode it's deprecated because on Lollipop it has being replaced by a new paradigm.
您有两种选择,至少有:
You have two options, at least:
-
忽略它,除非你的目标21+的API,并只对棒棒堂发展。
Ignore it unless you are targeting 21+ API and developing only for Lollipop.
使用AppCompat;这里的样本: https://github.com/google/iosched
Use AppCompat; samples here: https://github.com/google/iosched
就个人而言,我去选1。
Personally, I went for option 1.
这篇关于动作条setnavigationmode德precated的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!