在android TV中,当焦点从一行移动到另一行时,是否有方法停止RowsSupportFragment中行的垂直移动?

在android TV中,当焦点从一行移动到另一行时,是否有方法停止RowsSupportFragment中行的垂直移动?,android,android-tv,leanback,Android,Android Tv,Leanback,我一直试图阻止RowsSupport片段中的垂直运动。我有两行,我希望它们始终显示在固定位置上 在android电视中,只要焦点在行中垂直移动,下一行就会向上移动并离开其原始位置。我想把它垂直固定 如果有办法,请帮我解决这个问题。要保持焦点固定吗 以下代码将使焦点位置固定到第一行: // Item alignment affects focused row that isn't the last. getVerticalGridView().setItemAlignmentOff

我一直试图阻止RowsSupport片段中的垂直运动。我有两行,我希望它们始终显示在固定位置上

在android电视中,只要焦点在行中垂直移动,下一行就会向上移动并离开其原始位置。我想把它垂直固定


如果有办法,请帮我解决这个问题。

要保持焦点固定吗

以下代码将使焦点位置固定到第一行:

    // Item alignment affects focused row that isn't the last.
    getVerticalGridView().setItemAlignmentOffset(0);
    getVerticalGridView().setItemAlignmentOffsetPercent(0);
    // Push rows to the top.
    getVerticalGridView().setWindowAlignmentOffset(0);
    getVerticalGridView().setWindowAlignmentOffsetPercent(0);
getVerticalGridView().setWindowAlignment(VerticalGridView.WINDOW\u ALIGN\u LOW\u EDGE)

有关详细信息,请查看以下链接:
要保持焦点固定吗

以下代码将使焦点位置固定到第一行:

    // Item alignment affects focused row that isn't the last.
    getVerticalGridView().setItemAlignmentOffset(0);
    getVerticalGridView().setItemAlignmentOffsetPercent(0);
    // Push rows to the top.
    getVerticalGridView().setWindowAlignmentOffset(0);
    getVerticalGridView().setWindowAlignmentOffsetPercent(0);
getVerticalGridView().setWindowAlignment(VerticalGridView.WINDOW\u ALIGN\u LOW\u EDGE)

有关详细信息,请查看以下链接: