Gavin.han

致力于移动开发 技术改变生活

导航

上一页 1 ··· 7 8 9 10 11 12 13 14 下一页

2012年10月27日

摘要: //slider控件值改变- (IBAction)sliderChanged:(id)sender { UISlider *slider = (UISlider *)sender;//用一个UISlider对象来接收sender int intValue = (int)(slider.value); NSString *strValue = [[NSString alloc] initWithFormat:@"%d",intValue];//将int 转化为NSString类型的一种方法 sliderLabel.text = strValue; [strValue rele 阅读全文

posted @ 2012-10-27 14:59 gavin.han 阅读(2257) 评论(0) 推荐(1) 编辑

摘要: 方法一:在button按钮的点击事件中加上[self.textFiled resignFirstResponder];方法二:在xib文件中,可以不在View页面上添加一个View控件 ,一个简单的办法是将View页面的类设置为UIControl(该类继承与UIView).h文件:#import <UIKit/UIKit.h>@interface HomeViewController : UIViewController@property (retain, nonatomic) IBOutlet UITextField *nameField;@property (retain, n 阅读全文

posted @ 2012-10-27 12:46 gavin.han 阅读(261) 评论(0) 推荐(0) 编辑

摘要: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; // Override point for customization after application launch. self.window.backgroundColor = [U... 阅读全文

posted @ 2012-10-27 12:39 gavin.han 阅读(410) 评论(0) 推荐(0) 编辑

2012年10月26日

摘要: 一、贴图为快玩法: 如果杀死10个僵尸,通过次关;点击进入下一关时,僵尸的速度变大。 如果家里进来15只僵尸,则输了,重玩此关。 点击杀死僵尸时播放音频,输赢也有音频播放,有背景音乐。二、业务逻辑及知识点1.主要由两个类来完成,类1:主页面显示类RootViewController:UIImageView;类2:僵尸类:ZombieView:UIImageView。2.播放音频类:#import <AVFoundation/AVAudioPlayer.h>,需要添加,NSString *deadPath = [[NSBundle mainBundle] pathForResourc 阅读全文

posted @ 2012-10-26 21:14 gavin.han 阅读(473) 评论(0) 推荐(0) 编辑

2012年10月22日

摘要: 常用属性:frame,bounds和center重要方法 :addSubview 把一个子控件添加到一个父控件中;Superview 返回子控件的父控件常用函数:- (void)removeFromSuperview; - (void)insertSubview:(UIView *)view atIndex: (NSInteger)index; - (void)exchangeSubviewAtIndex: (NSInteger)index1 withSubviewAtIndex:(NSIn... 阅读全文

posted @ 2012-10-22 11:59 gavin.han 阅读(375) 评论(0) 推荐(0) 编辑

摘要: 上面的通过代码实现:NSString *str = @"字符串大小字符串大小字符串大小字符串大小"; UIFont *font = [UIFont fontWithName:@"Arial" size:50.0f]; CGSize size = CGSizeMake(320, 2000); UILabel *label = [[UILabel alloc] initWithFrame:CGRectZero]; [label setNumberOfLines:0]; CGSize labelSize = [str sizeWi... 阅读全文

posted @ 2012-10-22 11:46 gavin.han 阅读(251) 评论(0) 推荐(0) 编辑

2012年10月19日

摘要: 1.新建一个Empty Application项目新建一个oc文件(UITableViewController),命名为:HomeViewController2.在HomeViewController.h中声明全局变量NSArray *dataArray;3.在HomeViewController.m中添加代码- (void)viewDidLoad{ [super viewDidLoad]; //数组的初始化 dataArray = [[NSArray alloc] initWithObjects:@"A",@"B",@"C",@&q 阅读全文

posted @ 2012-10-19 23:05 gavin.han 阅读(1230) 评论(0) 推荐(0) 编辑

摘要: 1.新建Empty Applicationcommand+n,添加一个oc文件(UIViewController),命名为:HomeViewController2.在HomeViewController.h中声明全局变量 UIView *tView;3.在HomeViewController.m中://创建View的函数-(void) loadView{ [super loadView]; //创建View //UIView *tView; tView = [[UIView alloc] initWithFrame:CGRectMake(100, 100, 100... 阅读全文

posted @ 2012-10-19 22:47 gavin.han 阅读(192) 评论(0) 推荐(0) 编辑

摘要: 1.新建一个Empty Application程序修改文件appDelegate.m在方法- (BOOL)application::添加以下代码: //视图,hanjun tview = [[UIView alloc] initWithFrame:CGRectMake(100, 100, 100, 100)]; tview.backgroundColor = [UIColor redColor]; [self.window addSubview:tview]; //创建按钮 UIButton *btn = [UIButton buttonWithType:... 阅读全文

posted @ 2012-10-19 22:11 gavin.han 阅读(216) 评论(0) 推荐(0) 编辑

2012年10月18日

摘要: winform项目一、贴图为快二、源码using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Threading;using System.Drawing.Drawing2D;namespace SimulatedClock{ /// <summary> /// a 阅读全文

posted @ 2012-10-18 22:39 gavin.han 阅读(267) 评论(0) 推荐(0) 编辑

上一页 1 ··· 7 8 9 10 11 12 13 14 下一页