【问题标题】:Add button to BrowseFragment将按钮添加到 BrowseFragment
【发布时间】:2017-04-09 16:56:45
【问题描述】:

我正在使用 Leanback support library 开发一个 Android TV 应用。我需要在BrowseFragment 的右上角(徽章下方)显示一个按钮。 (如下图)

这是布局代码

<?xml version="1.0" encoding="utf-8"?>

<fragment xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main_browse_fragment"
    android:name="tv.bishan.com.videoapp.ui.ItemFragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity"
    tools:deviceIds="tv"
    tools:ignore="MergeRootFrame"/>

我怎样才能做到这一点?无法从 Google 找到任何解决方案。

【问题讨论】:

  • 您能否显示一些屏幕截图或提示,以便我们了解您到底想要什么。
  • @jaydroider 检查改进的问题。
  • 如果你使用的是 BrowseFragment 模板,我认为是不支持的

标签: android-tv leanback browsefragment


【解决方案1】:

您可以创建自定义 TitleView 并使用 browseTitleViewLayout 属性将其设置为活动主题。

【讨论】:

    猜你喜欢
    • 2017-08-15
    • 2018-06-13
    • 2013-03-07
    • 2014-03-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多