草庐IT

ActionBar-PullToRefresh

全部标签

android - ActionBar MenuItem 分隔符

有没有办法在HoneyComb+的ActionBar中的菜单项之间显示分隔符。有些帖子说只有当菜单项有android:showAsAction="withText"时才会显示分隔线。我只想显示图标而不是文本。我通过实现ActionBarCompatibility成功地展示了Pre-HoneyComb的Divider。我不想使用这篇文章中给出的ActionBarSherlockAndroidactionbarsherlokdoesn'tshowdivider因为是时候在我的所有项目中将ActionBarCompatibility更改为ActionBarSherlock。当我看到Andro

android - 应用程序图标在 android Lollipop 及更高版本的 Actionbar 上不可见

我刚刚从api19Kitkat迁移到api21Lollipop。现在我发现应用程序图标不在操作栏上。我觉得我的应用程序看起来有点不同。那么有没有办法显示应用程序图标。 最佳答案 在Material主题(以及基于它的AppCompat版本21)中,操作栏遵循materialdesignguidelines并使用Toolbar:Atitleandsubtitle.ThetitleshouldbeasignpostfortheToolbar'scurrentpositioninthenavigationhierarchyandthecon

android - SherlockActionBar : How to adjust CustomView against actionBar

问题:我怎样才能取回标题?这是屏幕截图(缺少标题):操作栏设置:ActionBaractionBar=getSupportActionBar();actionBar.setTitle("MyTitle");actionBar.setIcon(drawable.dropdown_user);ViewmLogoView=LayoutInflater.from(this).inflate(R.layout.mLogoView,null);actionBar.setCustomView(mLogoView);actionBar.setDisplayShowCustomEnabled(true)

android - 我怎样才能在我的 ActionBar (ActionBarSherlock) 上有阴影?

我包括我的样式化xml布局:@style/Widget.MyApp.ActionBar@style/Widget.MyApp.ActionBar@style/Widget.MyApp.TitleTextStyle@color/red@color/red@null@null@color/white21sp一些互联网搜索建议使用windowContentOverlay设置为@null。但是当我在样式xml中使用它时,它不会改变任何东西。谁能帮忙做一下吗? 最佳答案 如果您想在ActionBar下方创建阴影,您必须在应用程序主题上设置an

android - 如何在 Android 中滚动 ListView 时隐藏 ActionBar?

我需要创建一个带有ListView和ActionBar的GUI,它会在向下滚动时隐藏,而在向上滚动时必须重新出现。以下指南对我没有帮助:https://mzgreen.github.io/2015/06/23/How-to-hideshow-Toolbar-when-list-is-scrolling%28part3%29/https://github.com/ksoichiro/Android-ObservableScrollView我需要这样的东西: 最佳答案 如果您想获得具有此行为的列表,您应该:使用compile'com.a

android - 将一项对齐到 ActionBar 的左侧

我想将一个项目对齐到ActionBar的左侧,将其他项目对齐到右侧,如下所示:我的菜单xml中有5个项目。ma​​in.xml我们应该怎么做?抱歉我的英语很糟糕。 最佳答案 您可以为ActionBar创建自己的自定义View,其中这个左侧元素将类似于简单的ImageView,而其他菜单项将与通常的菜单项一样。此处示例:http://javatechig.com/android/actionbar-with-custom-view-example-in-android 关于android-

android - Theme.AppCompat.Light.DarkActionBar 结果没有显示 ActionBar

我在AndroidStudio中创建了一个包含空白Activity的项目(然后编写代码以放入基本fragment-空线性布局),但没有显示ActionBar。为什么?设备:模拟器(Nexus5尺寸),API19主要Activity扩展FragmentActivity。AndroidStudio生成的styles.xml:Activity布局:fragment:list: 最佳答案 我需要主类来扩展AppCompatActivity,而不是扩展FragmentActivity。如这里所解释的:http://developer.andr

objective-c - UIViewController 中的 PullToRefresh TableView

我有一个UIViewController,它也是UITableViewDelegate,除此之外,还有一个UITableView,在FirstView.xib@interfaceFirstViewController:UIViewController{UITableView*searchResults;//thisisthepropertyforthetableview...我希望此TableView使用PullToRefresh:https://github.com/leah/PullToRefresh,但那里的文档只解释了如何将该类用作ViewController的子类#impor

android - 当 onPrepareOptionsMenu 切换菜单项时如何刷新 ActionBar?

在我的应用程序中,我经常启用/禁用菜单条目,并让它们在onPrepareOptionsMenu中可见。今天我开始在我的一些Android2.x应用程序中添加android:showAsAction菜单属性,以在ActionBar上显示最常用的菜单条目。ActionBar不会立即反射(reflect)启用/禁用和可见性。我需要点击右侧的下拉菜单才能看到这种变化。好的,我知道菜单会触发onPrepareOptionsMenu。但是我需要做什么来刷新ActionBar?我认为需要从onOptionsItemSelected中应用此更改,但我不知道应该调用什么。这是菜单:这是onPrepare

android - 当 onPrepareOptionsMenu 切换菜单项时如何刷新 ActionBar?

在我的应用程序中,我经常启用/禁用菜单条目,并让它们在onPrepareOptionsMenu中可见。今天我开始在我的一些Android2.x应用程序中添加android:showAsAction菜单属性,以在ActionBar上显示最常用的菜单条目。ActionBar不会立即反射(reflect)启用/禁用和可见性。我需要点击右侧的下拉菜单才能看到这种变化。好的,我知道菜单会触发onPrepareOptionsMenu。但是我需要做什么来刷新ActionBar?我认为需要从onOptionsItemSelected中应用此更改,但我不知道应该调用什么。这是菜单:这是onPrepare