当前位置: 软件>java软件
Android 月视图控件 MonthView
来源: http://www.oschina.net/p/monthview
发布时间:2014-12-21
本文导语: 用于Android开发中自定义的月视图控件,使用简单,可以很方便自定义各种漂亮的风格。XML中布局: java代码:monthView.setAdapter(new MonthAdapter() { @Override public View createCellView(ViewGroup viewGroup, int position) ...
用于Android开发中自定义的月视图控件,使用简单,可以很方便自定义各种漂亮的风格。
XML中布局:
java代码:
monthView.setAdapter(new MonthAdapter() { @Override public View createCellView(ViewGroup viewGroup, int position) { TextView textView = new TextView(getContext()); textView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); textView.setGravity(Gravity.CENTER); return textView; } @Override public void bindCellView(ViewGroup viewGroup, View child, int position, Calendar calendar) { TextView textView = (TextView) child; textView.setText(""+calendar.get(Calendar.DAY_OF_MONTH)); } });
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。