我看到一个奇怪的问题。我的通知内容上的自定义布局在通知滚动条上不完全可见。我想知道为什么。
注意最后一个通知布局,2 个按钮部分可见。
相关代码
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 为根的布局。
最佳答案
很可能您使用的是相对布局,应该通过定义 TextView 的左/右边界来避免 TextView 重叠。
赞"To Left Of" , "To Right Of" ....:)
关于Android 自定义通知布局在选项卡后面修剪,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14422059/