【问题标题】:I want to show Action Bar with date string and next and previous button on it.我想在操作栏上显示日期字符串以及下一个和上一个按钮。
【发布时间】:2014-12-03 08:57:49
【问题描述】:

我应该执行哪些步骤来实现它?

我已经创建了操作栏,但我被困在进一步的步骤中

【问题讨论】:

    标签: android android-activity android-fragments android-actionbar


    【解决方案1】:

    您必须使用“自定义视图”:

    actionbar.setCustomView(your_custom_view)
    actionbar.setDisplayShowCustomEnabled(true);
    

    教程:

    http://javatechig.com/android/actionbar-with-custom-view-example-in-android

    【讨论】:

      【解决方案2】:

      试试这样,

      ActionBar actionBar = getSupportActionBar();
      actionBar.setCustomView(R.layout.your_custom_actionbar_view);
      actionBar.setIcon(null);
      actionBar.setDisplayShowCustomEnabled(true);
      actionBar.setDisplayHomeAsUpEnabled(false);
      actionBar.setDisplayUseLogoEnabled(false);
      actionBar.setHomeButtonEnabled(false);
      

      希望对你有帮助

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-07-29
        • 1970-01-01
        • 1970-01-01
        • 2021-02-01
        • 1970-01-01
        • 2016-01-22
        相关资源
        最近更新 更多