首页 文章 精选 留言 我的

精选列表

搜索[表格控件],共10000篇文章
优秀的个人博客,低调大师

Android——使用ListView实现多级树形控件

思路:反复适配listview上的数据; 2.实现方法: (1)创建数据bean(包含一些属性信息); (2)转化为树节点TreeNode(id,parentId,bean); (3)用所有的树节点构建一棵树包括(根节点和其他节点); (4)Adapter的实现: 1)创建两个节点列表,一个保存list要显示的节点(showList),一个保存所有的节点(cache); 2)初始化是显示根节点; 3)每次的展开与收缩都是将被点击的节点的展开状态设为相反状态; 4)每次展开都是将所有的根节点和父节点为展开状态的节点设配到ListView中(清空showList,在cache中找到相应节点放到showList中); 5)在收缩方法中要注意把要收缩节点的子节点都从showList删去; 6)在adapter类中调用notifyOnDatasetChanged()方法; 源码下载地址:http://down.51cto.com/data/1976008 本文转自wauoen51CTO博客,原文链接:http://blog.51cto.com/7183397/1604907,如需转载请自行联系原作者

优秀的个人博客,低调大师

Android:控件Spinner、getResources、setDropDownViewResource、setOnItemSelect...

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 public class MainActivity extends Activity { /** * 1.XML文件配置: * 添加弹出对话框的标题: android:prompt="@string/spinnername1" * 2.Adapter的布局:android.R.layout.simple_spinner_item * resource设置结果显示框的布局:new ArrayAdapter(context, resource, textViewResourceId) * 3.点击事件:s1.setOnItemSelectedListener * 4.设置弹出对话框的行布局: * adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); * * 5.得到资源文件:Resources res = getResources() * 6.通过资源id获取资源文件的内容:String[] arrStr = res.getStringArray(R.array.colors) * */ @Override protected void onCreate(Bundle savedInstanceState) { super .onCreate(savedInstanceState); setContentView(R.layout.activity_main); Spinner spinner1 = (Spinner) findViewById(R.id.spinner1); Resources res = getResources(); String[] arrStr = res.getStringArray(R.array.colors); ArrayAdapter<String> adapter = new ArrayAdapter<String>( this , R.layout.spinnertextview, arrStr); /** * 1.APIdemo的原写法: * ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource( this, R.array.colors, android.R.layout.simple_spinner_item); * 2.ArrayAdapter.createFromResource * 此方法将R.array.colors这个字符串数组文件的内容得到(通过id得到资源,通过方法得到内容) */ adapter.setDropDownViewResource(R.layout.spinnercheckeditem); spinner1.setAdapter(adapter); spinner1.setOnItemSelectedListener( new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { Toast.makeText(MainActivity. this , "Spinner1: position=" + position + " id=" + id, Toast.LENGTH_SHORT).show(); } @Override public void onNothingSelected(AdapterView<?> parent) { Toast.makeText(MainActivity. this , "Spinner1: unselected" , Toast.LENGTH_SHORT).show(); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_main, menu); return true ; } } 本文转自 glblong 51CTO博客,原文链接:http://blog.51cto.com/glblong/1203966,如需转载请自行联系原作者

优秀的个人博客,低调大师

iOS常用控件尺寸大集合

iPhone App Icon: 图标名称 尺寸 用途 是否必需 Icon.png 57×57 App Store和iPhone、iPod touch桌面显示 是 Icon@2x.png 114×114 Icon.png的高清模式 是 Icon-Small.png 29×29 “设置”应用和Soptlight搜索 否 Icon-Small@2x.png 58×58 Icon-Small.png的高清模式 否 iPad App Icon: 图标名称 尺寸 用途 是否必需 Icon-72.png 72×72 iPad桌面显示 是 Icon-50.png 50×50 Spotlight搜索 否 Icon-29.png 29×29 “设置”应用 否 iPhone、iPad通用App Icon: 图标名称 尺寸 用途 是否必需 Icon.png 57×57 App Store和iPhone、iPod touch桌面显示 是 Icon-72.png 72×72 iPad桌面显示 是 Icon-50.png 50×50 iPad的Soptlight搜索 否 Icon-29.png 29×29 “设置”应用和iPhone、iPod touch的Soptlight搜索 否 延伸阅读:Points VS. Pixels The iPhone 4 introduced a high resolution display with twice the pixels of previous iPhones. However you don't have to modify your code to support high-res displays; the coordinate system goes by points rather than pixels, and the dimensions in points of the screen and all UI elements remain the same. iOS 4 supports high resolution displays (like the iPhone 4 display) via the scale property on UIScreen, UIView, UIImage, and CALayer classes. If the object is displaying high-res content, its scale property is set to 2.0. Otherwise it defaults to 1.0. All you need to do to support high-res displays is to provide @2x versions of the images in your project. See the checklist for updating to iOS4 or Apple documentation for Supporting High Resolution Screens for more info. 译: iPhone 4引入了高分辨率显示器两倍的像素的以前的iPhone。但是你不需要修改代码以支持高分辨率显示器;坐标系统的流逝点而不是像素,在屏幕的尺寸点和所有UI元素保持不变。 iOS 4支持高分辨率显示器(像iPhone 4显示)通过在UIScreen scale特性,UIView,UIImage,CALayer类。如果对象是显示高清晰的内容,其规模属性设置为2.0。否则它的默认值为1.0。 所有您需要做的来支持高分辨率显示器是提供@2x版本的图像在您的项目中。看到检查表更新到iOS4或苹果文档支持高分辨率屏幕获取更多的信息。 原文连接:http://dangpu.sinaapp.com/?p=59 本文转自新风作浪 51CTO博客,原文链接:http://blog.51cto.com/duxinfeng/1208731,如需转载请自行联系原作者

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

用户登录
用户注册