Man*_*nju 8 android android-widget android-layout
是否可以在Android警报对话框中拥有多行标题?我尝试了几个解决方案,但没有一个适合我.我总是以标题显示3点(...)字符串.任何样本代码或相关的示例代码都将受到高度赞赏.
Yoj*_*mbo 30
您需要使用builder.setCustomTitle():
AlertDialog.Builder builder = new AlertDialog.Builder(context);
TextView textView = new TextView(context);
textView.setText("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur " +
"tincidunt condimentum tristique. Vestibulum ante ante, pretium porttitor " +
"iaculis vitae, congue ut sem. Curabitur ac feugiat ligula. Nulla " +
"tincidunt est eu sapien iaculis rhoncus. Mauris eu risus sed justo " +
"pharetra semper faucibus vel velit.");
builder.setCustomTitle(textView);
Run Code Online (Sandbox Code Playgroud)
文档在这里:AlertDialog.builder
| 归档时间: |
|
| 查看次数: |
12035 次 |
| 最近记录: |