找回密码
 立即注册
theLayoutParams布局mIcon | android开发 2022-11-07 48 0star收藏 版权: . 保留作者信息 . 禁止商业使用 . 禁止修改作品
基于Android源码实现的FileManager文件管理使用,使用BaseAdapter来存储获得的文件,源码中有丰富的注释,对android新手来说,帮助挺大。部分源码注释:super(context);//设置布局方法一个文件包括文件名和图表,选用一个笔直线性布局this.setOrientation(HORIZONTAL);mIcon=newImageView(context);//设置ImageView为文件的图标mIcon.setImageDrawable(aIconifiedText.getIcon());//设置图标在该布局中的填充方位mIcon.setPadding(8,12,6,12);//将ImageView即图表添加到该布局中addView(mIcon,newLinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));//设置文件名、填充方法、字体大小mText=newTextView(context);//将文件名添加到布局中//重写getView方法来回来一个IconifiedTextView(我们自定义的文件布局)对象……本资料共包括以下附件:

(FileManager file management based on Android source code uses BaseAdapter to store the obtained files. The source code contains rich comments, which is very helpful for Android novices. Some source code comments: super (context)// Set the layout method. A file includes file name and chart. Select a pen to lay out this. setOrientation (HORIZONTAL) linearly; mIcon=newImageView(context);// Set ImageView as the icon of file mIcon. setImageDrawable (aIconifiedText. getIcon())// Set the filling orientation of the icon in the layout mIcon. setPadding (8, 12, 6, 12)// Add the ImageView, that is, the chart, to the layout addView (mIcon, newLinearLayout. LayoutParams (LayoutParams. WRAP_CONTENT, LayoutParams. WRAP_CONTENT))// Set file name, filling method and font size mText=newTextView (context)// Add the file name to the layout.//Rewrite the getView method to return an IconifiedTextView (our customized file layout) object... This data includes the following attachments:)

[下载]13484488288.rar




上一篇:TodayDate Android日历源代码
下一篇:电池监控源码,Android编程实例