[更新]
我通过添加 addHeaderView 解决了这个问题:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mTitle = mDrawerTitle = getTitle();
mPlanetTitles = getResources().getStringArray(R.array.planets_array);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mDrawerList = (ListView) findViewById(R.id.left_drawer);
LayoutInflater inflater = getLayoutInflater();
ViewGroup mTop = (ViewGroup)inflater.inflate(R.layout.header_listview_menu, mDrawerList, false);
mDrawerList.addHeaderView(mTop, null, false);
=================================
我的问题很简单!
我想如何在导航抽屉中添加标题?
我已经为每个项目创建了带有列表视图(图标+文本)的导航抽屉。
非常感谢,