我正在寻找覆盖选项卡样式逐个选项卡的基础上,以便我可以将效果应用于某些选项卡,同时使其他人正常。自定义操作栏选项卡视图忽略layout_gravity
这是我用于自定义选项卡的布局XML。
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/CustomActionBarTabTextStyle"
android:ellipsize="end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"/>
继更新()在com.actionbarsherlock.internal.widget.ScrollingTabContainerView.TabView的实施已经相应地设置布局PARAMS和文字椭圆。我的CustomActionBarTabTextStyle现在唯一重写的是文本大小。
这些选项卡要像没有自定义视图一样进行渲染,除非文本在选项卡中是顶部对齐的。在层次结构查看器中快速运行显示layout_gravity显示为NONE,而layout_gravity为非自定义选项卡的CENTER_VERTICAL。这怎么可能?有没有人有办法解决这个问题?我试过把android:layout_gravity =“center_vertical”放在风格和主题上,没有任何结果。
遇到同样的问题,这个工作现在 – 2014-06-21 00:40:55