Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用片段开发一个 android 应用程序。主布局应分为两个片段,一个是列表视图片段,另一个应该是具有编辑框和其他项目的布局。我能够在第二个布局中显示但无法启动的图像我应该做的布局。如果您对此有任何想法,请分享。提前致谢。
使用片段事务设置片段。
Fragment f=SomeFragment.newInstance(someparams...) FragmentTransaction ft=getFragmentManager().beginTransaction(); ft.replace(R.id.someid, f); ft.commit();
R.id.someid 是布局中片段的 id。