gpt4 book ai didi

Android:Cast MiniControllerFragment定制

转载 作者:行者123 更新时间:2023-12-02 03:09:19 25 4
gpt4 key购买 nike

我正在尝试自定义 castBackground 和 castProgressBarColor MiniControllerFragment 属性,如官方文档中所述: https://developers.google.com/cast/docs/android_sender_advanced

我的 Activity 使用以下样式:

 <style name="AppTheme.NoActionBarNoTitle" parent="Theme.AppCompat.Light.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="castIntroOverlayStyle">@style/CustomCastIntroOverlay</item>
<item name="castMiniControllerStyle">@style/CustomCastMiniController</item>
</style>

这是 CustomCastMiniController 风格:

   <style name="CustomCastMiniController" parent="CastMiniController">
<item name="castShowImageThumbnail">true</item>
<item name="castTitleTextAppearance">@style/TextAppearance.AppCompat.Subhead</item>
<item name="castSubtitleTextAppearance">@style/TextAppearance.AppCompat.Caption</item>
<item name="castBackground">#FFFFFF</item>
<item name="castProgressBarColor">#FFFFFF</item>
</style>

我无法构建,因为这些错误:

Error:(2073, 21) No resource found that matches the given name: attr 'castBackground'.
Error:(2074, 21) No resource found that matches the given name: attr 'castProgressBarColor'.

如果我在我的 CustomCastMiniController 样式应用程序中删除这两个属性,则会成功启动。

最佳答案

属性 castBackgroundcastProgressBarColor 是在更高版本的 Google Cast SDK 中引入的,如 release notes 中所示:

Oktober 24, 2016

  • Added ability to customize the style of mini controllers: added castBackground for setting its background color, castButtonColor to color all buttons used in the mini controller, and castProgressBarColor to color the progress bar.

因此,请确保您在 build.gradle 文件中使用最新版本的 Google Cast SDK 进行编译(撰写本文时版本为 10.0.0 ):

dependencies {
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.support:mediarouter-v7:25.0.1'
compile 'com.google.android.gms:play-services-cast-framework:10.0.0'
}

关于Android:Cast MiniControllerFragment定制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40705212/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com