【发布时间】:2013-11-29 04:29:44
【问题描述】:
我的 Android 应用程序中定义了一个 ListPopupWindow,如下所示。
ListPopupWindow listPopupWindow;
listPopupWindow = new ListPopupWindow(RootView.this);
listPopupWindow.setAdapter(new ArrayAdapter<String>(RootView.this,
R.layout.push_list_item, pushMessages));
listPopupWindow.setAnchorView(bEvents);
listPopupWindow.setWidth(300);
listPopupWindow.setHeight(400);
listPopupWindow.setModal(true);
listPopupWindow.show();
上面引用的布局的 XML 如下所示..
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF0000"
android:paddingLeft="6dp"
android:textSize="12sp"
android:maxLines="3"
android:lines="3"
android:ellipsize="end"
android:textStyle="bold" />
当我得到一个更大的文本时,文本似乎只是剪裁而不是换行,即使我在 XML 中指定了正确的属性。任何人都可以帮助我了解这里发生了什么,并为我的问题提出解决方案。
谢谢..
【问题讨论】:
-
请张贴快照,因为我尝试了您的代码,它工作正常。
-
@avinash 是的,即使我尝试了代码,它似乎还可以
标签: android