问题
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 version 24.2.0
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:
enableMainFragmentScaling(false);
in BrowseFragmentsetExpand(false);
in the nested RowsFragments. But it didn't change anything.
The Code is very similar to the demo leanback project. But there they have row scaling enabled. Demo on Github
回答1:
I was able to achieve this affect by calling setExpand(true)
as the first line of my onCreateView()
in my RowsFragment
.
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.
回答2:
You should call to
enableRowScaling(false);
on the onActivityCreated method of your MainFragment.java class
来源:https://stackoverflow.com/questions/39508222/disable-row-scaling-expand-in-browsefragment