当前位置:  编程技术>移动开发
本页文章导读:
    ▪UIView详解一        UIView详解1一个UIView的实例就是一个视图,表示的是屏幕上的一块矩形区域,负责这块矩形区域的描绘以及和用户的交互。 第一、UIView的可视化属性 1. backgroundColor  背景属性 2. hidden  表示该.........
    ▪ 关于 typedef & typedef struct & typedef union理解 -写给不长脑子的小弟我        关于 typedef & typedef struct & typedef union理解 --写给不长脑子的我来源:http://zhidao.baidu.com/link?url=qxzkx5gaoCfnHnygYdzaLEWkC45JqNYYUk42eHHjB0yB3ZMgHv6lGjnq3CRfgQw8uJVesKck7ao7zT1HAQrWoa  http://zhidao.baidu.com/link?.........
    ▪ 游戏营业的一些概念       游戏运营的一些概念渠道:提供APP下载的平台,或者说第三方市场。 国内渠道主要有安智、安卓、百度、91(已被百度收购,花了19亿银子)、百度、360手机助手、应用汇、腾讯应用中心等等.........

[1]UIView详解一
    来源: 互联网  发布时间: 2014-02-18
UIView详解1

一个UIView的实例就是一个视图,表示的是屏幕上的一块矩形区域,负责这块矩形区域的描绘以及和用户的交互。

第一、UIView的可视化属性

1. backgroundColor  背景属性

2. hidden  表示该view是否隐藏,

hidden属性为YES时视图隐藏,否则不隐藏。

3. alpha  为0时完全透明,为1时完全不透明

注意事项:

当视图完全透明或者隐藏时,不能响应触摸消息。

也就是alpha等于0.0或者hidden为YES的时候,但是当alpha<0.01的时候,视图就已经接收不到消息了。

 视图的alpha值会影响子视图的绘制,但是子视图的alpha值不变。

4. opaque  property
这是一个优化属性,如果该值为YES, 那么绘图在绘制该视图的时候把整个视图当作不透明对待。这样,绘图系统在执行绘图过程中会优化一些操作并提升系统性能;如果是设置为NO, 绘图系统将其和其他内容平等对待,不去做优化操作。为了性能方面的考量,默认被置为YES(意味着‘优化’)。
另一方面,这个消息和alpha 是有关系的。 一个不透明视图需要整个边界里面的内容都是不透明的。基于这个原因,opaque设置为YES,要求对应的alpha必须为1.0。如果一个UIView实例opaque被设置为YES, 而同时它又没有完全填充它的边界(bounds),或者它包含了整个或部分的透明的内容视图,那么将会导致未知的结果。
因此,如果视图部分或全部支持透明,那么你必须把opaque这个值设置为NO. 

5. clipsToBounds  

在类的层次结构中,如果clipsTobounds设为YES,超出superView的部分subview就不会显示,否则会做显示, 默认情况下是NO。

6. clearsContextBeforeDrawing  

A Boolean value that determines whether the receiver’s bounds should be automatically cleared before drawing.

7. layerClass和 layer  property 跟Core Animation layer有关

第二、管理视图层次

1. superview  property 返回该view的superView

sample:

    [self.windowaddSubview:self.viewController.view];

    NSLog(@"the superView is %@",[self.viewController.viewsuperview]);

2. subviews  property 返回该view的subviews

sample:

    NSLog(@"the suberViews are %@",[self.windowsubviews]);

3. window  property 返回该view的window,如果没有返回nil

    NSLog(@"the window is %@",[self.viewController.viewwindow]);

4. – addSubview:

5. – bringSubviewToFront:

把指定的子view放到最顶层,其父视图调用bringSubviewToFront()方法。

sample:

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    UIButton *button=[[[UIButton alloc] initWithFrame:CGRectMake(120, 120, 50, 50)] autorelease];
    button.backgroundColor=[UIColor redColor];
    [self.view addSubview:button];
    
    UIButton *button2=[[[UIButton alloc] initWithFrame:CGRectMake(130, 130, 50, 50)] autorelease];
    button2.backgroundColor=[UIColor blueColor];

    [self.view addSubview:button2];
    [self.view bringSubviewToFront:button];
    
}

6.--sendSubviewToBack:

将一个UIView层推送到背后只需要调用其父视图的 sendSubviewToBack()方法。

sample:

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    UIButton *button=[[[UIButton alloc] initWithFrame:CGRectMake(120, 120, 50, 50)] autorelease];
    button.backgroundColor=[UIColor redColor];
    [self.view addSubview:button];
    
    UIButton *button2=[[[UIButton alloc] initWithFrame:CGRectMake(130, 130, 50, 50)] autorelease];
    button2.backgroundColor=[UIColor blueColor];

    [self.view addSubview:button2];
    [self.view sendSubviewToBack:button2];
    
    //[self.view bringSubviewToFront:button];
    
}

7.– removeFromSuperview

sample:

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    UIButton *button=[[[UIButton alloc] initWithFrame:CGRectMake(120, 120, 50, 50)] autorelease];
    button.backgroundColor=[UIColor redColor];
    [self.view addSubview:button];
    
    UIButton *button2=[[[UIButton alloc] initWithFrame:CGRectMake(130, 130, 50, 50)] autorelease];
    button2.backgroundColor=[UIColor blueColor];

    [self.view addSubview:button2];
  
    [button removeFromSuperview];
}
8.– insertSubview:atIndex:

Parameters

view

The view to insert. This value cannot be nil.

index

The index in the array of the subviews property at which to insert the view. Subview indices start at0 and cannot be greater than the number of subviews.

sample:

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    UIButton *button=[[[UIButton alloc] initWithFrame:CGRectMake(120, 120, 50, 50)] autorelease];
    button.backgroundColor=[UIColor redColor];
    [self.view addSubview:button];
    
    UIButton *button2=[[[UIButton alloc] initWithFrame:CGRectMake(130, 130, 50, 50)] autorelease];
    button2.backgroundColor=[UIColor blueColor];

    [self.view addSubview:button2];
    
    
    UIButton *button3=[[[UIButton alloc] initWithFrame:CGRectMake(120, 120, 100, 100)] autorelease];
    button3.backgroundColor=[UIColor greenColor];
    [self.view insertSubview:button3 atIndex:2];
}
9.– insertSubview:aboveSubview:

Inserts a view above another view in the view hierarchy.

- (void)insertSubview:(UIView *)view aboveSubview:(UIView *)siblingSubview

sample:

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    UIButton *button=[[[UIButton alloc] initWithFrame:CGRectMake(120, 120, 50, 50)] autorelease];
    button.backgroundColor=[UIColor redColor];
    [self.view addSubview:button];
    
    UIButton *button2=[[[UIButton alloc] initWithFrame:CGRectMake(130, 130, 50, 50)] autorelease];
    button2.backgroundColor=[UIColor blueColor];

    [self.view addSubview:button2];
    
    
    UIButton *button3=[[[UIButton alloc] initWithFrame:CGRectMake(120, 120, 100, 100)] autorelease];
    button3.backgroundColor=[UIColor greenColor];

    [self.view insertSubview:button3 aboveSubview:button];
}
10.– insertSubview:belowSubview:

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    UIButton *button=[[[UIButton alloc] initWithFrame:CGRectMake(120, 120, 50, 50)] autorelease];
    button.backgroundColor=[UIColor redColor];
    [self.view addSubview:button];
    
    UIButton *button2=[[[UIButton alloc] initWithFrame:CGRectMake(130, 130, 50, 50)] autorelease];
    button2.backgroundColor=[UIColor blueColor];

    [self.view addSubview:button2];
    
    
    UIButton *button3=[[[UIButton alloc] initWithFrame:CGRectMake(120, 120, 100, 100)] autorelease];
    button3.backgroundColor=[UIColor greenColor];
    [self.view insertSubview:button3 belowSubview:button];
}
11.– exchangeSubviewAtIndex:withSubviewAtIndex:

- (void)exchangeSubviewAtIndex:(NSInteger)index1 withSubviewAtIndex:(NSInteger)index2

Parameters

index1

The index of the first subview in the receiver.

index2

The index of the second subview in the receiver.

sample:

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    UIButton *button=[[[UIButton alloc] initWithFrame:CGRectMake(120, 120, 50, 50)] autorelease];
    button.backgroundColor=[UIColor redColor];
    [self.view addSubview:button];
    
    UIButton *button2=[[[UIButton alloc] initWithFrame:CGRectMake(130, 130, 50, 50)] autorelease];
    button2.backgroundColor=[UIColor blueColor];

    [self.view addSubview:button2];
    
    
    UIButton *button3=[[[UIButton alloc] initWithFrame:CGRectMake(120, 120, 100, 100)] autorelease];
    button3.backgroundColor=[UIColor greenColor];
    [self.view addSubview:button3];
    [self.view exchangeSubviewAtIndex:1 withSubviewAtIndex:3];
}

12– isDescendantOfView:

Returns a Boolean value indicating whether the receiver is a subview of a given view or identical to that view.

- (BOOL)isDescendantOfView:(UIView *)view

sample:

    NSLog(@"the result is %d",[button3isDescendantOfView:self.view]);






    
[2] 关于 typedef & typedef struct & typedef union理解 -写给不长脑子的小弟我
    来源: 互联网  发布时间: 2014-02-18
关于 typedef & typedef struct & typedef union理解 --写给不长脑子的我
来源:http://zhidao.baidu.com/link?url=qxzkx5gaoCfnHnygYdzaLEWkC45JqNYYUk42eHHjB0yB3ZMgHv6lGjnq3CRfgQw8uJVesKck7ao7zT1HAQrWoa
 http://zhidao.baidu.com/link?url=zgu7JtWBqJlUzNjrrWDZew4Cx3jMfnxkV1sqgBWDq6_Fcz2t1csh8nausPMz3YoL8gN76dI0hdSE8oEdnQDJ6_
写作原由,今晚再次查了typedef用法,就在这用着查着中做着一个个项目,可我还是记不住;脑子里装得是什么?
 
 
typedef    struct
问题1:
请高手帮忙解释以下几种结构体定义的区别:
struct{
  int x;
  int y;
}test1;

struct test
{int x;
int y;
}test1;

typedef struct test
{int x;
int y
}text1,text2;
这几种方法把小弟弄得头疼,不胜感激!
 
 
 
(1) struct{ int x; int y; }test1; 
好,定义了 结构 test1,
test1.x 和 test1.y 可以在语句里用了。

(2) struct test {int x; int y; }test1; 
好,定义了 结构 test1,
test1.x 和 test1.y 可以在语句里用了。
与 1 比,省写 了 test

(3) 
typedef struct test 
{int x; int y;  // 你漏打分号,给你添上 
}text1,text2; 
只说了 这种结构 的(类型)别名 叫 text1 或叫 text2

真正在语句里用,还要写:
text1 test1;
然后好用 test1.x test1.y

或写 text2 test1;
然后好用 test1.x test1.y

(4)type struct {int x; int y; }test1;
这个不可以。
改 typedef ... 就可以了。
但也同 (3)一样,还要 写:
test1 my_st;
才能用 my_st.x 和 my_st.y
 
typedef union
问题2: 
#include <stdio.h> 
typedef union 
{long i; 
int k[5]; 
char c; 
}DATE; 
struct date 
{ 
int cat; 
DATE cow; 
double dog; 
}too; 
DATE max; 
main() 
{printf("%d\n",sizeof(struct date)+sizeof(max));} 

程序结果为52,搞不懂……希望能给出详细解题过程!!!
int k[5]是占几个字节呀??20还是10呀??
 
union是公用的,所以DATA的大小是int k[5] =4*5 = 20

struct 是自己用自己的,所以大小是4+20+8 = 32

结果就是52

    
[3] 游戏营业的一些概念
    来源: 互联网  发布时间: 2014-02-18
游戏运营的一些概念

渠道:提供APP下载的平台,或者说第三方市场。

国内渠道主要有安智、安卓、百度、91(已被百度收购,花了19亿银子)、百度、360手机助手、应用汇、腾讯应用中心等等等等。

渠道推广是应用推广的最主要形式。当然也有新的推广形式,比如微信推广。这种通过SNS推广,效果也是非常显著。

游戏运营商:指通过自主开发或取得其它游戏开发商的代理权运营网络游戏,以出售游戏时间、游戏道具或相关服务为玩家提供增值服务和放置游戏内置广告,从而获得收入的网络公司。简单说就是大型游戏公司。

国内运营商主要有网易、盛大、腾讯、网龙(被百度收购)、完美、绿岸、巨人、金山、搜狐。

移动运营商:提供移动通信业务的服务部门。地球人都知道,天朝就是移动、联通、电信。

游戏公司与移动运营商合作,并推广自己产品,以获得稳定的现金流。从用户角度看,神马充点卡、买装备,最方便还是通过发短信。

截取一段其他人的概括:

  网络游戏供应链基本有四类角色组成:开发商、运营商、渠道商和网吧。特别要强调的是,其中的一些角色还要细分,比如开发商要分为海外开发商和国内开发商;运营商要分为全国运营商和区域运营商;渠道商要为分全国渠道商和区域渠道商;网吧要分为连锁网吧和独立网吧。各个角色都有非常知名的企业,如开发商中的金山、网易;运营商中的盛大、九城;渠道商中宽联、骏网、晶合;网吧中的联通网苑、武汉星网吧等。

网吧也是网游产业链的一部分,一般玩网游的,肯定一惊然后肯定悟了!网吧的玩家成份一般比较复杂,玩家在网吧充点卡或者买装备之类,但是在校学生肯定是占很大一块。玩游戏从娃娃抓起啊!!之后肯定通过这些人有部分成为了那些游戏忠实玩家。

手游市场附近的事儿:

百度收购91网龙。

安智、腾讯、小米等等提供市场广告SDK。小米推出红米手机的意图也不难见了。

微信游戏推广,SNS推广游戏的新形势,其实也很老套(主要微信用户多而已、比如YY也可以做)。

个人开发者的路呢?

 个人开发者的路相对难走,中国是酝酿不出‘愤怒的小鸟’那种奇迹。各种抄袭、盗版、模仿,开发的难题,没有好的UI。

最后发个小广告:

万普世纪:这个平台是目前为止收入最高的一个平台,但也是被各发布渠道拒绝使用该平台应用上架的广告平台。

现在有新的广告形式,叫棒棒推荐,可以上安智、安卓等大市场。 其主要广告为广告条、积分墙、推送3种模式,主要以CPA广告为主。
地址: http://www.waps.cn/?f=zhanchiky。万普最新活动页:http://www.waps.cn/news.jsp?id=58620

慢慢探究,一路思考,光明大道路就在前方。


    
最新技术文章:
▪Android开发之登录验证实例教程
▪Android开发之注册登录方法示例
▪Android获取手机SIM卡运营商信息的方法
▪Android实现将已发送的短信写入短信数据库的...
▪Android发送短信功能代码
▪Android根据电话号码获得联系人头像实例代码
▪Android中GPS定位的用法实例
▪Android实现退出时关闭所有Activity的方法
▪Android实现文件的分割和组装
▪Android录音应用实例教程
▪Android双击返回键退出程序的实现方法
▪Android实现侦听电池状态显示、电量及充电动...
▪Android获取当前已连接的wifi信号强度的方法
▪Android实现动态显示或隐藏密码输入框的内容
▪根据USER-AGENT判断手机类型并跳转到相应的app...
▪Android Touch事件分发过程详解
▪Android中实现为TextView添加多个可点击的文本
▪Android程序设计之AIDL实例详解
▪Android显式启动与隐式启动Activity的区别介绍
▪Android按钮单击事件的四种常用写法总结
▪Android消息处理机制Looper和Handler详解
▪Android实现Back功能代码片段总结
▪Android实用的代码片段 常用代码总结
▪Android实现弹出键盘的方法
▪Android中通过view方式获取当前Activity的屏幕截...
▪Android提高之自定义Menu(TabMenu)实现方法
▪Android提高之多方向抽屉实现方法
▪Android提高之MediaPlayer播放网络音频的实现方法...
▪Android提高之MediaPlayer播放网络视频的实现方法...
▪Android提高之手游转电视游戏的模拟操控
 


站内导航:


特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

©2012-2021,,E-mail:www_#163.com(请将#改为@)

浙ICP备11055608号-3