首页 文章 精选 留言 我的

精选列表

搜索[ui],共10002篇文章
优秀的个人博客,低调大师

View UI(原 iView) 4.1.0 发布

4.1.0 Pascal's Wager Table: 支持树形数据。 新增属性indent-size,可设置树形的缩进宽度。 新增属性load-data,树形数据异步时使用。 row-key支持 String 类型,使用树形数据时必须为 String。 column 新增属性tree,树形数据使用,开启则该列为可展开列。 data 新增属性_showChildren,树形数据使用,指定默认子数据是否展开。 data 新增属性_loading,树形数据使用,用于异步请求子数据。 新增属性context-menu,开启后,当前行点击右键会阻止默认行为。 新增事件@on-contextmenu,当前行点击右键时触发。 其它: Select 新增事件@on-select,选择项目时触发。 Carousel 新增事件@on-click,点击幻灯片时触发,返回索引值。 Tree 使用 Render 时,可以直接使用选中功能。 Affix 新增属性use-capture。 修复 Carousel 内的 CarouselItem 样式重叠的问题。 修复 Carousel 点击指示器时,不触发 on-click 事件的问题。 修复 Collapse 异步加载时,不能打开面板的问题。 修复 Split 嵌套使用时,有时样式出错的问题。 修复 FormItem 没有监听 required 属性改变的问题。 修复 AutoComplete 的 transfer 属性,在全局配置有时错误的问题。 修复 AutoComplete 的事件 on-select 有时不触发的问题。 修复 Modal confirm 关闭按钮事件问题。 修复 TimePicker 使用向上箭头选择时出错的问题。 修复 DatePicker 有时选择日期,错误的问题。 修复 DatePicker setMonth 的问题。 修复 Split 的 min 和 max 属性在改变浏览器尺寸时不正确的问题。 修复 Time 不能动态设置 time 属性的问题。#199 修复 Avatar 自定义尺寸有时样式出错的问题。 修复 Tree 数据设置 disabled 时,不能点击箭头的问题。 修复 TypeScript 的一些问题。 新增维吾尔语。

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

Swift UI学习UITableView and protocol use

Models: UserModel.swift Views: UserInfoCell.swift Controllers: RootViewController.swift, DetailViewController.swift AppDelegate.swift: import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary? ) -> Bool { self.window = UIWindow(frame: UIScreen.mainScreen().bounds) // let rootController = RootViewController(style: UITableViewStyle.Plain) let rootNav = UINavigationController(rootViewController: rootController) self.window!.rootViewController = rootNav // self.window!.backgroundColor = UIColor.whiteColor() self.window!.makeKeyAndVisible() return true } } UserModel.swift import Foundation // // @brief The model of user, using to store user datas // @author huangyibiao // class UserModel : NSObject { var userName: String ///< store user's name, optional var userID: Int ///< store user's ID var phone: String? ///< store user's telephone number var email: String? ///< store user's email // designated initializer init(userName: String, userID: Int, phone: String?, email: String?) { self.userName = userName self.userID = userID self.phone = phone self.email = email super.init() } } UserInfoCell.swift: import Foundation import UIKit // // @brief The cell of showing user infos // @author huangyibiao // class UserInfoCell : UITableViewCell { var userNameLabel : UILabel! var phoneLabel : UILabel! var emailLabel : UILabel! init(style: UITableViewCellStyle, reuseIdentifier: String!) { super.init(style: style, reuseIdentifier: reuseIdentifier) userNameLabel = UILabel(frame: CGRectMake(30, 0, 100, 44)) userNameLabel.backgroundColor = UIColor.clearColor() userNameLabel.font = UIFont.systemFontOfSize(14) self.contentView.addSubview(userNameLabel) phoneLabel = UILabel(frame: CGRectMake(120, 0, 200, 20)) phoneLabel.backgroundColor = UIColor.clearColor() phoneLabel.font = UIFont.systemFontOfSize(12) self.contentView.addSubview(phoneLabel) emailLabel = UILabel(frame: CGRectMake(120, 20, 200, 20)) emailLabel.backgroundColor = UIColor.clearColor() emailLabel.font = UIFont.systemFontOfSize(12) self.contentView.addSubview(emailLabel) } func configureCell(userModel: UserModel?) { if let model = userModel { userNameLabel.text = model.userName phoneLabel.text = model.phone emailLabel.text = model.email } } } RootViewController.swift: import Foundation import UIKit // // @brief 作为窗体的rootViewControllor // @author huangyibiao // class RootViewController : UITableViewController, DetailViewControllerDelegate { var dataSource = NSMutableArray() var currentIndexPath: NSIndexPath? override func viewDidLoad() { super.viewDidLoad() for index in 0...12 { let model = UserModel(userName: "name:\(index + 1)", userID: index, phone: "13877747982", email: "632840804@qq.com") dataSource.addObject(model) } self.title = "UITableViewDemo" } override func tableView(tableView: UITableView!, numberOfRowsInSection section: Int) -> Int { return dataSource.count } override func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! { // can't use static? let cellIdentifier: String = "UserInfoCellIdentifier" // may be no value, so use optional var cell: UserInfoCell? = tableView.dequeueReusableCellWithIdentifier(cellIdentifier) as? UserInfoCell if cell == nil { // no value cell = UserInfoCell(style: UITableViewCellStyle.Default, reuseIdentifier: cellIdentifier) } let model: UserModel? = dataSource[indexPath.row] as? UserModel cell!.configureCell(model) return cell } override func tableView(tableView: UITableView!, didSelectRowAtIndexPath indexPath: NSIndexPath!) { let detail = DetailViewController() detail.userModel = dataSource[indexPath.row] as? UserModel detail.delegate = self currentIndexPath = indexPath self.navigationController.pushViewController(detail, animated: true) } func changeItem(forUserModel userModel: UserModel?) { var index = 0 for index = 0; index < dataSource.count; index++ { let model = dataSource[index] as UserModel if model.userID == userModel?.userID { model.phone = userModel? .phone model.email = userModel?.email tableView.reloadRowsAtIndexPaths([currentIndexPath!], withRowAnimation: UITableViewRowAnimation.Fade) break } } } } DetailViewController.swift: import Foundation import UIKit // this delegate needs a @objc, because @optional is only for objective-c, not for swift @objc protocol DetailViewControllerDelegate : NSObjectProtocol { @optional func changeItem(forUserModel userModel: UserModel?) } class DetailViewController : UIViewController { var userModel: UserModel? var delegate: DetailViewControllerDelegate? override func viewDidLoad() { super.viewDidLoad() self.view.backgroundColor = UIColor.whiteColor() self.title = userModel? .userName let button = UIButton(frame: CGRectMake(10, 200, 300, 40)) button.setTitle("change", forState:UIControlState.Normal) button.backgroundColor = UIColor.redColor() button.addTarget(self, action: "onChangeButtonClick:", forControlEvents: UIControlEvents.TouchUpInside) self.view.addSubview(button) } func onChangeButtonClick(sender: UIButton!) { if userModel { userModel!.userName = "ChangeName" // changeItem needs to add a ? to the end, before (), because // this function is optional // delegate? 表示可能没有代理。而changeItem? 表示方法可能没有实现,这样写就算没有实现也没有问题 delegate?.changeItem? (forUserModel: userModel) self.navigationController.popViewControllerAnimated(true) } } } 效果图: 版权声明:本文博客原创文章,博客,未经同意,不得转载。 本文转自mfrbuaa博客园博客,原文链接:http://www.cnblogs.com/mfrbuaa/p/4727952.html,如需转载请自行联系原作者

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

Android:UI控件GestureOverlayView、gesture、手势

XML代码: 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 <android.gesture.GestureOverlayView xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:tools= "http://schemas.android.com/tools" android:id= "@+id/gestureOverlayView1" android:layout_width= "match_parent" android:layout_height= "match_parent" android:layout_alignParentLeft= "true" android:layout_alignParentTop= "true" > <RelativeLayout android:layout_width= "match_parent" android:layout_height= "match_parent" tools:context= ".MainActivity" > <TextView android:id= "@+id/textView1" android:layout_width= "wrap_content" android:layout_height= "wrap_content" android:layout_alignParentTop= "true" android:layout_centerHorizontal= "true" android:layout_marginTop= "30dp" android:text= "Large Text" android:textAppearance= "?android:attr/textAppearanceLarge" /> <CheckBox android:id= "@+id/checkBox1" android:layout_width= "wrap_content" android:layout_height= "wrap_content" android:layout_below= "@+id/textView1" android:layout_centerHorizontal= "true" android:layout_marginTop= "24dp" android:text= "CheckBox" /> </RelativeLayout> </android.gesture.GestureOverlayView> 本文转自 glblong 51CTO博客,原文链接:http://blog.51cto.com/glblong/1228590,如需转载请自行联系原作者

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

Android UI学习 - Linear Layout, RelativeLayout

1. 一些常用的公共属性介绍 1) layout_width- 宽 fill_parent: 宽度和父元素相同,wrap_content: 宽度随本身的内容所调整,或者指定 px 值来设置宽 2) layout_height -高 fill_parent: 高度和父元素相同,wrap_content: 高度随本身的内容所调整,或者指定 px 值来设置高 3) background - 设置背景图 4) padding - 设置边距 可以具体设置paddingBottom,paddingLeft,paddingRight,paddingTop来设定不同的px值 5) id - 该object的id号 @+id/id1 代表添加新的id名为id1, @id/id1 代表引用id1的控件 6) layout_weight - 重要度 个人理解为显示的优先级。默认为0(最高),数值越大,优先级越低!参考下面的Linear Layout例子。要让layout_weight生效,需要父层或父父层的相应layout_width/layout_height = "fill_parent",否则wrap_content会压缩到最小足够空间! 7) layout_gravity -Container组件的对齐方式 组件在layout里面的对齐方式。 8)gravity - 文字在组件里的对齐方式 例如设置button里面的文字在button中居中显示。 *大多数属性是可以调用对应的函数来动态改变状态的,请查看SDK Doc。 2. Linear Layout线形布局 orientation- 容器内元素的排列方式。vertical: 子元素们垂直排列,horizontal: 子元素们水平排列。在代码里可通过setOrientation()进行动态改变,值分别为HORIZONTAL或者VERTICAL。 * 在Linear Layout, 宽度/高度都是按着组件的次序逐个占用的!所以当某个组件设置"fill_parent",在没有设置Layout_weight的情况下,该组件会占用了余下的空间,那么在它后面的组件就会显示不出来。如下图的EditText如果没有设置android:layout_weight="1", 它下面的其他组件就看不见了! baselineAligned一般情况下,这个属性默认为true,代表在同一方向的组件都基于第一个组件对齐。所以可以看到下图的text1, button1, text2是在同一水平线的。当不需要这效果时,可以设置为false。 可以参考官方网页 http://androidappdocs.appspot.com/resources/tutorials/views/hello-linearlayout.html。 xml代码: <?xmlversion="1.0"encoding="utf-8"?> <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:text="@string/hello" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:id="@+id/edittext" /> <LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:text="text1" android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <Buttonandroid:text="Button01" android:id="@+id/Button01" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" /> <TextView android:text="text2" android:id="@+id/TextView02" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="buttom" /> </LinearLayout> 3.RelativeLayout 相对定位布局 这个布局比较易懂,但组件间容易存在依赖关系,“牵一发而动全身“,所以在确定组件间布局关系不会再变动时,可以考虑采用!先看看xml代码: <?xmlversion="1.0"encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/relativelayout"> <ImageView android:id="@+id/image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/icon" /> <TextView android:id="@+id/text1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" android:layout_toRightOf="@id/image" /> <Button android:id="@+id/button1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="button1" android:layout_toRightOf="@id/image" android:layout_below="@id/text1" /> </RelativeLayout> Java代码(动态添加组件): publicclassRelativeDemoextendsActivity{ @Override publicvoidonCreate(BundlesavedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.relative); RelativeLayout.LayoutParamslp=newRelativeLayout.LayoutParams( ViewGroup.LayoutParams.FILL_PARENT,//width ViewGroup.LayoutParams.WRAP_CONTENT//height ); //设置editTextlayout_below="@id/button1" lp.addRule(RelativeLayout.BELOW,R.id.button1); //设置editTextlayout_alignLeft="@id/image" lp.addRule(RelativeLayout.ALIGN_LEFT,R.id.image); ((RelativeLayout)findViewById(R.id.relativelayout)).addView( newEditText(this),lp); } } 效果图: 先添加参照物(ImageView),然后就可以依次添加其他组件,定义位置规则rule!位置规则是不分先后的!另外ADT插件提供的预览图,有时候是不准的,未能及时更新,所以最好还是要到模拟器上测试! RelativeLayout的xml属性很多,总的来说分为2类: 1) 要指定参照物的,layout_alignBottom,layout_toLeftOf,layout_above,layout_alignBaseline系列的; layout_above = ”@id/text1“ 2) 以parent为参照物,设置true/false,layout_centerVertical,layout_alignParentLeft系列的。 layout_alignParentLeft = ”true“ 其中 layout_alignWithParentIfMissing是比较有用且要注意的属性,当设置为true,在指定的参照物找不到的情况下,会使用parent作为新的参照物! RelativeLayout.LayoutParams是用于设置位置规则的。上述的xml属性均来自此静态类。但它的AddRule(int verb, int anchor),参数的verb动作却是引用RelativeLayout的常量,而这些常量和部分xml属性相对应。参数anchor的值可能是参照物的id,RelativeLayout.TRUE,-1(当不需要指定anchor的verb)。可以这样理解verb和anchor: xml属性 (verb) = "value" (anchor) 其中它的构造函数之一: RelativeLayout.LayoutParams(int w, int h),参数指定所要设置子View的宽度和高度。 本文转自 Icansoft 51CTO博客,原文链接:http://blog.51cto.com/android/298345

资源下载

更多资源
Mario

Mario

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

腾讯云软件源

腾讯云软件源

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

Spring

Spring

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

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册