getActionBar从片段与AppCompatLibrary [英] getActionBar from Fragment with AppCompatLibrary

查看:171
本文介绍了getActionBar从片段与AppCompatLibrary的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找从使用AppCompatLibrary和API 8片段获得的ActionBar实例,最简单的方法。

I'm look for the easiest way to get an ActionBar instance from a Fragment using AppCompatLibrary and API 8.

已经尝试过的事情一样。

Already tried things like

getActivity().getSupportActionBar() 

但没有运气。

推荐答案

尝试投它:

((YourActivity)getActivity()).getSupportActionBar()

这篇关于getActionBar从片段与AppCompatLibrary的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆