请大神指点一下,如何实现像Excel那样的网格界面,并且能在单元格里放入Button,ImageViem,TextView等组件
利用GridView的horizontalspacing和verticalspacing可以制作表格(利用背景颜色),然后在GridViewAdapter里面的getview方法里添加你想要放入的组件.
android:horizontalSpacing="5dp"
android:verticalSpacing="5dp"
@Override
public View getView(int position, View convertView, ViewGroup parent) {
TextView textView = new TextView(context);
textView.setText(""+position);
textView.setTextColor(Color.BLUE);
textView.setTextSize(20);
textView.setGravity(Gravity.CENTER);
textView.setBackgroundColor(Color.WHITE);
return textView;
}
http://www.360doc.com/content/15/0322/15/11800748_457158018.shtml
你可以百度表格布局看看