UI学习之常用方法(续)

UINavigationController

    UIButton *myButton = [UIButton buttonWithType:UIButtonTypeSystem];
    //[UIButton buttonWithType:UIButtonTypeCustom];//显示真实图标颜色
    myButton.frame = CGRectMake(0, 0, 30, 30);
//    myButton.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"home"]];
    [myButton setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal];//建议使用方式
//    [myButton setTitle:@"返回" forState: UIControlStateNormal] ;
    UIBarButtonItem *backButton = [[UIBarButtonItem alloc]initWithCustomView:myButton];
    UIButton *myButton1 = [UIButton buttonWithType:UIButtonTypeSystem];
    myButton1.frame = CGRectMake(0, 0, 30, 30);
    //    myButton.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"login"]];//无点击效果,保留色彩
    [myButton1 setImage:[UIImage imageNamed:@"home"] forState:UIControlStateNormal];//建议使用方式
    //    [myButton setTitle:@"返回" forState: UIControlStateNormal] ;
    UIBarButtonItem *backButton1 = [[UIBarButtonItem alloc]initWithCustomView:myButton1];
    self.navigationItem.leftBarButtonItem = backButton;
    self.navigationItem.rightBarButtonItem = backButton1;
时间: 2024-08-10 00:06:19

UI学习之常用方法(续)的相关文章

UI学习之常用方法

1.-(BOOL) respondsToSelector: selector 用来判断是否有以某个名字命名的方法(被封装在一个selector的对象里传递) 1 if ([delegate respondsToSelector:@selector(didFinishUpload:)]) { 2 [delegate didFinishUpload:self]; 3 } 2.self.window .rootViewController = loginVC;给window添加根视图控制器. 3. 

UI学习笔记---第六天

UIControl及其子类 UISegmentedControl的用法 UISegmentedControl是iOS中得分段控件,每个segment都能被点击,相当于集成了若干个button.通常我们会点击不同的segment来切换不同的view 常用方法 initWithItems: //UISegmentedControl独有的初始化方法,?用来创建多个分段 setTitle: forSegmentAtIndex: //为指定下标的分段设置title setImage: forSegment

UI学习笔记---第八天

UINavigationController的用法   界面间传值 UInavigationController继承于UIViewController,以栈的方式管理所控制的师徒控制器,至少要有一个被管理的视图控制器 创建的时候需要用户提供一个视图控制器作为导航控制器的一个根视图控制器 出栈和人栈 UINavigationController通过控制入栈和出栈来展示各个视图控制器 视图控制器切换常用方法 pushViewController:animated //进?下一个视图控制器 popVi

Android UI学习 - ListView (android.R.layout.simple_list_item_1是个什么东西)

Android UI学习 - ListView 2010-06-20 18:21:35 标签:Android UI 移动开发 ListView ListActivity 原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://android.blog.51cto.com/268543/336162 ListActivity ListActivity是一个专门显示ListView的Activity类,它内置了ListView对象,只要我

UI学习第二篇 (控件)

UIbutton 也是一个控件,它属于UIControl 用的最多的就是事件响应 1. //创建按钮对象 UIButton * _botton = [UIButton buttonWithType:UIButtonTypeCustom]; //设置标题 [_botton setTitle:@"按住说话" forstate:UIControlStateNormal]; [_botton setTitle:@"松开说话" forstate:UIControlStateH

UI学习笔记---第一天

一.iOS概述 iOS是Apple公司的移动操作系统,主要?用于iPhone.iPad.iPad Mini.iPod Touch等移动产品. 借助iOS,我们可以开发视频类.美图类.新闻类.?音乐类.团购类.电商类.阅读类.出?行类.?生活服务类.游戏类等应?用程序. 除此之外,iOS还可以与外部设备通信,开发出更多改变?活的产品,?比 如:智能家居(iOS App控制电视.空调等).健?产品(将人体健康 状况通过App直观的展现出来)等. 二.UI概述 UI(User Interface):?

Entity Framework 学习第二天 续

今天来写一点不一样的删除,修改,查询 下面只写了几个方法 1 /// <summary> 2 /// 根据删除条件进行删除 3 /// </summary> 4 /// <param name="removeWhere"></param> 5 public void remove(System.Linq.Expressions.Expression<Func<StudentInfo, bool>> removeWh

Entity Framework 学习第一天 续

改写第一天的增删改查方法,观察增删改查的本质 1 using System; 2 using System.Collections.Generic; 3 using System.Data.Entity.Infrastructure; 4 using System.Linq; 5 using System.Text; 6 using System.Threading.Tasks; 7 8 namespace EFConsole 9 { 10 class Program 11 { 12 publi

UI学习笔记---第十四天数据持久化

一.沙盒机制 每个应用程序位于文件系统的严格限制部分 每个应用程序只能在为该程序创建的文件系统中读取文件 每个应用程序在iOS系统内斗放在了统一的文件夹目录下 沙盘路径的位置 1. 通过Finder查找程序沙盘相对路径 ~/Library/Application Support/iPhone Simulator 2. 通过代码查找程序沙盘相对路径 NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory directory,NSSearc