禁用行缩放/在BrowseFragment中扩展 [英] Disable row scaling / expand in BrowseFragment

查看:126
本文介绍了禁用行缩放/在BrowseFragment中扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我还没有找到任何文档来说明如何将焦点从标题"切换到浏览片段"中的片段"时禁用行缩放.

I have not found any documentation how to disable the row scaling when switching the focus from the Headers to the Fragments in a BrowseFragment.

Leanback版本24.2.0

Leanback version 24.2.0

BrowseFragment具有功能enableMainFragmentScaling,可部分解决问题.图像现在具有完整大小,但标题仍没有像PlayStore应用程序,Youtube应用程序中那样扩展.聚焦一行时展开(没有动画).

The BrowseFragment has a function enableMainFragmentScaling which solves the problem partially. The images now have the full size, but the titles are still not expanded like they are in the PlayStore App, Youtube app. The expand (without animation) when focusing a row.

到目前为止我做了什么:

What i did so far:

    BrowseFragment中的
  • enableMainFragmentScaling(false);
  • 嵌套的RowsFragments中的
  • setExpand(false);.但这并没有改变任何东西.
  • enableMainFragmentScaling(false); in BrowseFragment
  • setExpand(false); in the nested RowsFragments. But it didn't change anything.

该代码与leanback演示项目非常相似.但是在那里他们启用了行缩放. 在Github上演示

The Code is very similar to the demo leanback project. But there they have row scaling enabled. Demo on Github

推荐答案

我能够通过将setExpand(true)作为我RowsFragment中我的onCreateView()的第一行来实现这种影响.

I was able to achieve this affect by calling setExpand(true) as the first line of my onCreateView() in my RowsFragment.

如果要永久锁定此效果,可以在RowsFragment中覆盖setExpand(...)并仅调用super.setExpand(true).我相信您仍然需要onCreateView()中的初始呼叫.

If you want to lock this effect forever, you can override setExpand(...) in your RowsFragment and just call super.setExpand(true). I believe you'll still need the initial call in onCreateView() though.

这篇关于禁用行缩放/在BrowseFragment中扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆