【问题标题】:Elevation not working on android seekbar海拔在android seekbar上不起作用
【发布时间】:2015-09-07 15:20:34
【问题描述】:

seekbar 似乎忽略了海拔?有什么办法让它运行吗?我已经将嵌入视图的背景更改为纯色,没有帮助。

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/white">
        <SeekBar
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:elevation="4dp" />
</RelativeLayout>

【问题讨论】:

  • 1- 您正在使用 Lollipop 设备测试您的代码,对吧? 2- Seekbars 具有阴影/发光/触摸状态(或自定义)...不需要高度。
  • 1) 是的,在棒棒糖上。 2) 嗯,我没有看到影子,只有光芒。
  • 这取决于您使用的 SDK... Lollipop 和 Material Design 为 SeekBar 使用 Glow(Holo 也使用它)。我认为您应该使用自定义 SeekBar 来实现“阴影”外观。
  • 好的,会玩更多,谢谢。如果有人知道“刚刚设置 xy=true”的技巧,那么问题是开放的。 :)

标签: android material-design android-seekbar android-elevation


【解决方案1】:

经过大量测试后,我决定将 SeekBar 嵌入到包装器视图中,并提升包装器而不是搜索栏。不是很酷,但很有效。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-03-05
    • 2021-05-05
    • 2015-01-11
    • 2016-05-22
    • 2019-01-03
    • 2014-12-25
    • 2023-03-17
    • 1970-01-01
    相关资源
    最近更新 更多