将按钮添加到BrowseFragment

问题描述:

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

hep_img

这里是布局代码

<?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的任何解决方案。

+0

你能否显示一些屏幕截图或提示,以便我们能够理解你到底想要什么。 –

+0

@jaydroider检查改进的问题。 – Bishan

+0

我认为它不支持,如果您使用BrowseFragment模板 –

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