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

动态创建的 TitleBar 子标题与副标题显示时未换行

zoujun8666 opened this issue · comments

问题描述(必填)
在Activity(继承AppCompatActivity)中用TitleUtils.addTitleBarDynamic创建的 TitleBar 子标题与副标题显示时未换行

使用的XUI版本(必填)
com.github.xuexiangjys:XUI:1.1.8
com.github.xuexiangjys.XUtil:xutil-core:2.0.0
com.github.xuexiangjys.XUtil:xutil-sub:2.0.0

如何重现(必填)
1.修改全局主题为继承XUITheme.Phone
2.在Activity中的onCreate中动态创建TitleBar
TitleBar titleBar = TitleUtils.addTitleBarDynamic(this, "主标题"); titleBar.setSubTitle("副标题");

期望的效果
主标题与副标题,显示在两行

截图
image

image

image

设备信息

  • 设备名: [e.g. 华为P20]
  • Android版本: [e.g. Android 6.0]
  • 设备型号 [e.g. ]
  • 系统版本(EXMUI 4.1.3)

附加信息

  • 模拟器问题一样
  • 如果使用xml的方式,则可以换行
    <com.xuexiang.xui.widget.actionbar.TitleBar android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="5dp" android:background="@color/xui_config_color_titlebar" app:tb_barHeight="65dp" app:tb_dividerColor="@color/xui_config_color_red" app:tb_leftImageResource="@drawable/icon_back_white" app:tb_leftText="回退" app:tb_sideTextPadding="20dp" app:tb_actionPadding="20dp" app:tb_subTitleText="这是副标题" app:tb_titleText="这是一个Title" />

用setTitle方法设置
【"\n"为垂直方向,"\t"为水平方向】