选项卡背后修剪的Android自定义通知布局

时间:2013-01-20 05:48:39

标签: android android-notifications

我看到一个奇怪的问题。我的通知内容上的自定义布局在通知滚动中不完全可见。我想知道为什么。

注意最后一个通知布局,2个按钮部分可见。

here

相关代码

RemoteViews contentView = new RemoteViews(getPackageName(), R.layout.pickupnotification);
    contentView.setTextViewText(R.id.title, "Siddharth" + "2km -> 20km");
    contentView.setTextViewText(R.id.countDown, "-1:29");
    contentView.setTextViewText(R.id.from,
            "FROM 2:00pm 14th Jan 2013, Some Address");
    contentView.setTextViewText(R.id.to,
            "TO4:00pm 14th Jan 2013 Some address");
Notification noti = new NotificationCompat.Builder(this).setContent(contentView)
...
notification.contentView = contentView ;

我使用RelativeLayout作为root的布局。

1 个答案:

答案 0 :(得分:1)

您可能正在使用相对布局,并且应该通过定义左/右边界来避免重叠文本视图。

"To Left Of""To Right Of" ....:)