【问题标题】:Set Title and SubTitle in CollapsingToolBar layout Android在 CollapsingToolBar 布局 Android 中设置 Title 和 SubTitle
【发布时间】:2015-10-27 06:51:45
【问题描述】:

如何在 Android 中的折叠工具栏布局中设置标题和子标题,如 whatsapp 配置文件视图。

我附上了相同的示例屏幕截图。

【问题讨论】:

    标签: android android-layout android-collapsingtoolbarlayout


    【解决方案1】:

    我终于得到了答案。 请检查链接。这就是我要的。 https://github.com/harcoPro/SubtitleCoordinatorLayoutExample

    【讨论】:

    • @UmarulFarukh 出现错误:Caused by: java.lang.ClassCastException: android.widget.LinearLayout cannot be cast to com.abc.xxx.HeaderView 在线 toolbarHeaderView = (HeaderView) findViewById(R.id.toolbar_header_view);
    • @HammadNasir 问题何时开始
    • @UmarulFarukh 这是一个RuntimeException。见:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.abc.xxx/com.abc.xxx.Profile}: java.lang.ClassCastException: android.widget.LinearLayout cannot be cast to com.abc.xxx.HeaderView
    • @UmarulFarukh 我在这里发布了一个相关问题:stackoverflow.com/q/41492631/6144372 请帮忙解决这个问题!
    • 我刚刚做了一个类似的库collapsingtoolbarlayout-subtitle,gradle-compatible。如果我可以让某人进一步测试它,我会非常喜欢它,因为我没有测试那么多。
    猜你喜欢
    • 1970-01-01
    • 2017-09-12
    • 1970-01-01
    • 2011-09-21
    • 2019-07-07
    • 2012-11-17
    • 2014-02-16
    • 1970-01-01
    • 2020-05-03
    相关资源
    最近更新 更多