如何使用 cicle 在相对布局中动态添加视图for
?
这是我的代码:
RemoteViews remoteViews = new RemoteViews(c.getPackageName(), R.layout.layout_1);
for(int i=0; i<10; i++){
RemoteViews newView = new RemoteViews(c.getPackageName(), R.layout.element);
newView.setImageViewResource(R.id.notif_toggle, R.drawable.bt_close_n);
remoteViews.addView(R.id.layout_1, newView);
}
int statusIcon = R.drawable.ic_launcher;
notification = new Notification(statusIcon, c.getResources().getString(R.string.app_name), System
.currentTimeMillis());
notification.flags = notification.flags | Notification.FLAG_NO_CLEAR | Notification.FLAG_ONGOING_EVENT;
notification.contentView = remoteViews;
nm.notify(3,notification);
我知道“正在添加的视图的子级具有属性 layout_alignParentBottom="true",这导致它填充整个父级,阻止任何其他子级。删除该属性允许其他子级出现”。
那么我该如何设置 layout_alignParentBottom="false"??非常感谢...