xuexiangjys / XUI

💍A simple and elegant Android native UI framework, free your hands! (一个简洁而优雅的Android原生UI框架,解放你的双手!)

Home Page:https://xuexiangjys.github.io/XUI/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

标题栏使用无效的问题

1411862854 opened this issue · comments

fragment页面xml:
`

<com.xuexiang.xui.widget.actionbar.TitleBar
    android:id="@+id/titlebar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:tb_actionPadding="20dp"
    app:tb_centerGravity="center"
    app:tb_titleText="这是一个Title"
    app:tb_useThemeColor="false"
    android:background="@color/app_color_theme_7"
    />

`
fragment页面class:
import com.xuexiang.xaop.annotation.SingleClick;
import com.xuexiang.xpage.annotation.Page;
import com.xuexiang.xpage.enums.CoreAnim;
import com.xuexiang.xui.utils.DensityUtils;
import com.xuexiang.xui.widget.actionbar.TitleBar;
import butterknife.BindView;
/**

  • @author xuexiang

  • @SInCE 2019-10-30 00:19
    */
    @page(anim = CoreAnim.none)
    public class NfcFragment extends BaseFragment {

    @BindView(R.id.titlebar)
    TitleBar mTitleBar;

    @nonnull
    @OverRide
    protected FragmentNfcBinding viewBindingInflate(@nonnull LayoutInflater inflater, @nullable ViewGroup container, boolean attachToRoot) {
    return FragmentNfcBinding.inflate(inflater, container, attachToRoot);
    }

    @OverRide
    protected int getLayoutId() {
    return R.layout.fragment_nfc;
    }

    /**

    • @return 返回为 null意为不需要导航栏
      */
      @OverRide
      protected TitleBar initTitle() {
      return null;
      }

    /**

    • 初始化控件
      */
      @OverRide
      protected void initViews() {
      mTitleBar.disableLeftView()
      .addAction(new TitleBar.ImageAction(R.drawable.icon_action_query) {
      @OverRide
      @singleclick
      public void performAction(View view) {
      openNewPage(SearchComponentFragment.class);
      }
      });
      }
      }
      `
      使用的是XUI模板工程。效果是左边返回按钮没有隐藏,没有添加右边的查询图标。
      1699600847264