我试图在我的 FrameLayout 中放置一个视图,但是该视图以给定的宽度和高度定位在左上角。
/**
* Adds a view to the window.
*/
public void AddPanel(PanelWrapper child, int Left, int Top, int Width, int Height) {
this.window.addView(child.getObject(), new BALayout.LayoutParams(Left, Top, Width, Height));
child.getObject().setPadding(Left, Top, 0, 0);
for (int i=0;i<child.getNumberOfViews();i++) {
Log.i("B4A", "View " + i);
ViewEventListener vel = new ViewEventListener();
vel.Initialize(this.ba, this.eventName, child.GetView(i).getObject());
}
ViewEventListener vel = new ViewEventListener();
vel.Initialize(this.ba, this.eventName, child.getObject());
}
我想要做的是将视图(PanelWrapper 是一个视图组)定位在给定尺寸的给定位置上。