android三级列表显示不完整的问题

lg891121 2011-11-03 05:45:57
expandablelistview的子列表项也用expandablelistview组成三级列表,但是三级列表显示不完整,高度不能自动调整,将layout_height设置为固定的一值(足够大)的时候可以全部显示出来,不管是设置为wrap_content还是fill_parent都不能正常显示像是发高度已经固定死了一样的,下面是getChildView()的代码:
public View getChildView(int groupPosition, int childPosition,
boolean isLastChild, View convertView, ViewGroup parent)
{
if(childPosition < notSubsection[groupPosition]){
View view = View.inflate(context, R.layout.childview, null);
TextView textView = (TextView)view.findViewById(R.id.childTextView);
textView.setText(getChild(groupPosition, childPosition).toString());
view.findViewById(R.id.childImageView2).setOnClickListener(new MyPictureOnClickListener(Intent.ACTION_CALL,Uri.parse("tel:"+telephone[groupPosition][childPosition])));
view.findViewById(R.id.childImageView3).setOnClickListener(new MyPictureOnClickListener(Intent.ACTION_SENDTO,Uri.parse("smsto:"+telephone[groupPosition][childPosition])));
view.findViewById(R.id.childImageView4).setOnClickListener(new MyPictureOnClickListener(Intent.ACTION_SENDTO,Uri.parse("mailto:"+email[groupPosition][childPosition])));
return view;
}
else{
AbsListView.LayoutParams lp = new AbsListView.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT);//设置宽度和高度
ExpandableListView expandableListView = new ExpandableListView(context);
SubsectionAdapter subsectionAdapter = new SubsectionAdapter(groupPosition,depSubsectionName[groupPosition].length, context);
expandableListView.setAdapter(subsectionAdapter);
expandableListView.setLayoutParams(lp);
return expandableListView;
}
求解???
...全文
463 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
jdpxiaoming 2011-11-04
  • 打赏
  • 举报
回复
你可以把字体放大尝试一下 比如 20

80,349

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧