我尝试在链接中实现第三个示例:http: //devblog.blackberry.com/2009/10/how-to-use-table-view-layout/
我做了一个简单的应用程序来尝试布局,但项目没有填满屏幕并停留在它的左侧。我想在示例链接中获得屏幕截图的确切视图。但是我的应用看起来像这样:
当我指向屏幕截图时,我想要右侧的 innerTable 项目。
这是我的代码:
TableLayoutManager outerTable = new TableLayoutManager(new int[]{
TableLayoutManager.USE_PREFERRED_SIZE,
TableLayoutManager.SPLIT_REMAINING_WIDTH
},USE_ALL_WIDTH);
TableLayoutManager innerTable = new TableLayoutManager(new int[]{
TableLayoutManager.USE_PREFERRED_SIZE,
TableLayoutManager.USE_PREFERRED_SIZE
},TableLayoutManager.USE_ALL_WIDTH);
TableLayoutManager innerTable2 = new TableLayoutManager(new int[]{
TableLayoutManager.USE_PREFERRED_SIZE,
TableLayoutManager.USE_PREFERRED_SIZE
},0);
innerTable.add(new LabelField("titleField"));
innerTable.add(new LabelField("title"));
innerTable.add(new LabelField("descriptionfield"));
innerTable.add(new LabelField("description"));
innerTable.add(new LabelField("rating field"));
innerTable.add(new LabelField("***"));
outerTable.add(new BitmapField(Bitmap.getBitmapResource("testimg.png"),Field.FOCUSABLE));
outerTable.add(innerTable);
innerTable2.add(new LabelField("titleField"));
innerTable2.add(new LabelField("title"));
innerTable2.add(new LabelField("descriptionfield"));
innerTable2.add(new LabelField("description"));
innerTable2.add(new LabelField("rating field"));
innerTable2.add(new LabelField("***"));
outerTable.add(new BitmapField(Bitmap.getBitmapResource("testimg.png"),Field.FOCUSABLE));
outerTable.add(innerTable2);
add(outerTable);
你有什么主意吗 ?谢谢