【发布时间】:2011-06-15 12:09:27
【问题描述】:
我需要创建一个带有更长文本的通知,可以吗?默认情况下不是,但您可以使用custom layout,这就是我所做的。现在我可以显示多行,但正如您所见,文本仍然损坏/未完全显示? ):有人可以告诉我我做错了什么/通知的大小是否有固定限制?如果您查看屏幕截图,您会注意到,还有很多空间...感谢您的任何提示!
顺便说一句,这是用于自定义布局的 XML,基于 http://developer.android.com/guide/topics/ui/notifiers/notifications.html#CustomNotification
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="3dp"
>
<ImageView android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="10dp"
/>
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:textColor="#000"
/>
</LinearLayout>
【问题讨论】:
-
尝试在所有视图上使用
layout_height="wrap_content"。 -
谢谢,但这不会改变任何事情):
-
据我所知,您无法将通知设置为大于屏幕截图中显示的默认大小,但我可能错了。
-
只是一个想法。向文本视图添加滚动视图有效吗?
-
至少不使用 remoteview 和 xml,因为 remoteview 不支持滚动视图):来源:stackoverflow.com/questions/4351459/… 以及我尝试它时收到的错误消息 ;-) 只是想知道我是否可以构建手动/按代码布局?
标签: android notifications