【问题标题】:?android:attr/actionBarSize not working in only one device. Why??android:attr/actionBarSize 仅在一台设备上不起作用。为什么?
【发布时间】:2016-05-12 18:20:46
【问题描述】:

Android 经验级别:新手。

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_marginTop="?android:attr/actionBarSize"
        android:padding="10dp"
        android:fillViewport="false">

我已将上边距应用于ScrollView,即actionBar 的高度。这在我的两个物理设备中运行良好,但不适用于一个。为什么一台设备不使用该值?

附上截图。

带有 Marshmallow 6.0 Stock ROM 的联想 A7000:

在操作栏下方,一两行不可见。可能在actionBar后面。

HTC 手机和三星平板电脑:文字显示正常。

【问题讨论】:

  • 您是否检查了从哪个文件夹中选择 res ?
  • 你使用 AppCompat 吗?尝试将边距更改为?actionBarSize
  • 是的。使用 AppCompat。
  • 这就是我用过的@ExceptionLover。 android:layout_marginTop="?android:attr/actionBarSize".

标签: android android-actionbar scrollview android-scrollview


【解决方案1】:

尝试将属性值更改为 ?attr/actionBarSize 而不是使用 ?android:attr/actionBarSize

【讨论】:

    猜你喜欢
    • 2021-12-22
    • 2016-01-25
    • 1970-01-01
    • 1970-01-01
    • 2020-01-09
    • 2013-06-18
    • 2021-12-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多