【发布时间】:2013-12-26 03:44:47
【问题描述】:
所以我有这门课叫书。这本书既是一个java类又是一个布局的xml文件。然后我有一个名为 book_shelf 的类/xml 文件。在我的 book_shelf xml 文件中,我有一个名为 book1 的视图。
public class book_shelf extends Activity {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.mainmenu, menu);
book MyBook = new book();
final View book1 = (View) findViewById(R.id.book1);
book1.(load my book xml layout in this view)
return true;
}
}
我想将书籍布局加载到我的书架框架的视图中。请和谢谢。
【问题讨论】:
-
book1.addView(MyBook);
标签: java android eclipse view android-inflate