如何获取要重命名的scrollview标题的id(应用栏中的标题)

时间:2016-07-28 15:18:36

标签: android android-studio uiscrollview android-appbarlayout

我想获取scrollview标题的id,以便我可以使用用户输入重命名它。有什么我可以放在xml或java中给它一些我可以引用的id

1 个答案:

答案 0 :(得分:1)

如果你有一个工具栏,也许这会很有用,试试这个:

# Lay out the three plots
p1 = plot_grid(top_plot, empty, scatter, right_plot, align="hv",
               rel_widths=c(3,1), rel_heights=c(1,3))

# Combine plot layout and legend
grid.arrange(p1, leg, heights=c(10,1))

或者,如果您有supportActionBar,请尝试:

TextView toolbarTextView;
for (int i = 0; i < yourToolbar.getChildCount(); ++i) {
    final View toolbarChild = yourToolbar.getChildAt(i);
    if (toolbarChild instanceof TextView) {
        toolbarTextView = (TextView) toolbarChild;
    }
}
相关问题