如何停止 addContentView 以隐藏我的 expendablelistview 的顶部?
我需要你的帮助,我的 expendablelistactivity 中有一个 expendablelistview 谁在我添加的 addContentView 中隐藏。我怎样才能阻止呢?
我只是希望我的 expendablelistview 遵循我的其他观点。
mAdapter = new MyExpandableListAdapter(context, groups, childrens);
this.setListAdapter(mAdapter);
LayoutInflater inflater = getLayoutInflater();
getWindow().addContentView(inflater.inflate(R.layout.actionbar, null),
new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
45));
registerForContextMenu(getExpandableListView());
I need your help please, I have an expendablelistview in my expendablelistactivity
who is hide with my adding do with addContentView. How can I stop that?
I just want my expendablelistview follow my other view.
mAdapter = new MyExpandableListAdapter(context, groups, childrens);
this.setListAdapter(mAdapter);
LayoutInflater inflater = getLayoutInflater();
getWindow().addContentView(inflater.inflate(R.layout.actionbar, null),
new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
45));
registerForContextMenu(getExpandableListView());
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 ExpandableListActivity 中,您有一个 ExpandableListView。时期。当您将适配器设置为它时,您不能在其上添加其他视图。(我几乎确定这不是一个好的做法)
我的建议是您在侧面创建一个 ExpadableListView 并将其放入加载到干净的普通活动中的布局(以及您想要的其他内容)。
有帮助吗?
JQ科雷亚
In an ExpandableListActivity you have an ExpandableListView. Period. When you set the Adapter to it, You can't then add other View on top of that.(I'm almost sure this isn't good practice)
My advice is that you create an ExpadableListView on the side and put it into a Layout(with the other things you want) that is loaded into a clean plain Activity.
Helped?
JQCorreia