安卓 android 4.0 的HTML5非常失望
大部分在IOS Firefox Chrome 运行正常的 jquery + html5。在android 4.0上面都运行不了。例如翻页、播放音乐、视频[js控制]。
官方说 4.0 不是用 Chrome 浏览器。以后才支持。
所以要在4.0上做html5 apps的同志门。要好好测试了。
iOS 5提供了一个新的framework – Newsstand framework,它允许把应用程序运行于News Stand中。实际上,News Stand相当于一个特制的文件夹专门放置报纸,杂志类应用程序。由于时间有限,这里我分几个部分介绍这一技术。
首先介绍的就是怎样把一个应用程序改变成一个News Stand程序,这实际上有两步工作,一是让程序运行于News Stand,二是改变程序的图标。
可以在Info.plist中添加
1
2 <key>UINewsstandApp</key>
<true/>
或者直接在Xcode中更改Info.plist(如图):

就这么简单,运行!你的程序就运行在News Stand中了。
不过,出现在News Stand中的是一个非常丑陋的白色方框。这一定不是你需要的效果。那么,我们需要第二步。
应用程序仍需定义标准图标,这些图标用于settings,search,Push等,(而且你的程序有可能运行于iOS 5以前的版本)。Newsstand 图标可以反应应用的内容,可以动态更新,另外还可以加一些修饰,使其看上去就像真正的杂志或者报纸。
你可以直接修改Info.plist
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 <key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>Icon.png</string>
<string>Icon@2x.png</string>
</array>
</dict>
<key>UINewsstandIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>NewsstandIcon1.png</string>
<string>NewsstandIcon1@2x.png</string>
</array>
</dict>
</dict>
或者直接使用Xcode编辑:

关于BindingType和BindingEdge应该很容易理解,我就不知赘述了。另外Newsstand中的图标不一定是正方形,只是不知有没有尺寸上的限制。

| Position Jan 2012 |
Position Jan 2011 |
Delta in Position | Programming Language | Ratings Jan 2012 |
Delta Jan 2011 |
Status |
|---|---|---|---|---|---|---|
| 1 | 1 | ![]() |
Java | 17.479% | -0.29% | A |
| 2 | 2 | ![]() |
C | 16.976% | +1.15% | A |
| 3 | 6 | ![]() ![]() ![]() |
C# | 8.781% | +2.55% | A |
| 4 | 3 | ![]() |
C++ | 8.063% | -0.72% | A |
| 5 | 8 | ![]() ![]() ![]() |
Objective-C | 6.919% | +3.91% | A |
| 6 | 4 | ![]() ![]() |
PHP | 5.710% | -2.13% | A |
| 7 | 7 | ![]() |
(Visual) Basic | 4.531% | -1.34% | A |
| 8 | 5 | ![]() ![]() ![]() |
Python | 3.218% | -3.05% | A |
| 9 | 9 | ![]() |
Perl | 2.773% | -0.08% | A |
| 10 | 11 | ![]() |
JavaScript | 2.322% | +0.73% | A |
| 11 | 12 | ![]() |
Delphi/Object Pascal | 1.576% | +0.29% | A |
| 12 | 10 | ![]() ![]() |
Ruby | 1.441% | -0.34% | A |
| 13 | 13 | ![]() |
Lisp | 1.111% | +0.00% | A |
| 14 | 14 | ![]() |
Pascal | 0.798% | -0.12% | A |
| 15 | 17 | ![]() ![]() |
Transact-SQL | 0.772% | +0.01% | A |
| 16 | 24 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
PL/SQL | 0.709% | +0.15% | A |
| 17 | 20 | ![]() ![]() ![]() |
Ada | 0.634% | -0.05% | B |
| 18 | 39 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Logo | 0.632% | +0.29% | B |
| 19 | 25 | ![]() ![]() ![]() ![]() ![]() ![]() |
R | 0.609% | +0.07% | B |
| 20 | 21 | ![]() |
Lua | 0.559% | -0.08% | B |
yii chtml 生成的 activeRadioButtonList 会带有一个 label
<div id="gender">
<label>Gender :</label>
<?php echo CHtml::radioButtonList('gender_code','',array('Male'=>'Male','Female'=>'Female'),array('separator'=>'')); ?>
</div>
label 导致 有一个长长的空格
分页
去除方法就是加一个 css 【display:inline】上去。代码如下
<?php echo CHtml::radioButtonList('gender_code','',array('Male'=>'Male','Female'=>'Female'),array(
'labelOptions'=>array('style'=>'display:inline'), // add this code
'separator'=>'',
)); ?>
'labelOptions'=>array('style'=>'display:inline')的作用是加上一些自定css
echo $form->radioButtonList($person,'gender_code',array('m'=>'Male','f'=>'Female'));
默认输出
<input id="ytPerson_gender_code" type="hidden" value="" name="Person[gender_code]" /> <input id="Person_gender_code_0" value="m" type="radio" name="Person[gender_code]" /> <label for="Person_gender_code_0">Male</label><br/> <input id="Person_gender_code_1" value="f" type="radio" name="Person[gender_code]" /> <label for="Person_gender_code_1">Female</label> 如果把换行符号<br/> 去掉也很简单 加上这一句
echo $form->radioButtonList($person,'gender_code', array('m'=>'Male','f'=>'Female'),array('separator'=>''));
把 separator 设为空就行了
| Position Dec 2011 |
Position Dec 2010 |
Delta in Position | Programming Language | Ratings Dec 2011 |
Delta Dec 2010 |
Status |
|---|---|---|---|---|---|---|
| 1 | 1 | ![]() |
Java | 17.561% | -0.44% | A |
| 2 | 2 | ![]() |
C | 17.057% | +0.98% | A |
| 3 | 3 | ![]() |
C++ | 8.252% | -0.76% | A |
| 4 | 5 | ![]() |
C# | 8.205% | +1.52% | A |
| 5 | 8 | ![]() ![]() ![]() |
Objective-C | 6.805% | +3.56% | A |
| 6 | 4 | ![]() ![]() |
PHP | 6.001% | -1.51% | A |
| 7 | 7 | ![]() |
(Visual) Basic | 4.757% | -0.36% | A |
| 8 | 6 | ![]() ![]() |
Python | 3.492% | -2.99% | A |
| 9 | 9 | ![]() |
Perl | 2.472% | +0.14% | A |
| 10 | 12 | ![]() ![]() |
JavaScript | 2.199% | +0.69% | A |
| 11 | 11 | ![]() |
Ruby | 1.494% | -0.29% | A |
| 12 | 10 | ![]() ![]() |
Delphi/Object Pascal | 1.245% | -0.93% | A |
| 13 | 13 | ![]() |
Lisp | 1.175% | +0.11% | A |
| 14 | 23 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
PL/SQL | 0.803% | +0.24% | A |
| 15 | 14 | ![]() |
Transact-SQL | 0.746% | -0.03% | A |
| 16 | 16 | ![]() |
Pascal | 0.734% | -0.03% | A |
| 17 | 18 | ![]() |
Ada | 0.632% | -0.02% | B |
| 18 | 35 | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Logo | 0.619% | +0.26% | B |
| 19 | 17 | ![]() ![]() |
Assembly | 0.563% | -0.10% | B |
| 20 | 25 | ![]() ![]() ![]() ![]() ![]() |
ABAP | 0.560% | +0.01% | B |
NSString* names[] = {@"20092222", @"220091111", @"5", @"5",nil};
NSString* values[] = {@"A", @"B", @"C", @"D", nil};
NSDictionary* dic = [NSDictionary dictionaryWithObjects
id*)names forKeys
id*)values count:4];
//
NSArray *xxxxx = [dic allKeysForObject:@"5"];
NSLog(@"xxxxx: %@", xxxxx);
键找值 是一对一的关系,NSDictionary 本质上是有2个数组组成的,2个数组的元素是一一映射的关系,通过键组找值组是没问题的,而通过值组找键组,就会出现问题,
因为键组(就好像书的页码一样)对象不允许重复,而值组对象(好比书里面的内容)却没什么要求,所以下面的方法,就是你找的,值找键,返回的是一个或者多个键。
- (NSArray *)allKeysForObject:(id)anObject
关于苹果对于数据结构的设计,其中就有一种是对字典结构的延伸,只不过他是2个数组或者更多个数组映射的关系。比如数据保存这块, Core Data 和 NSUserDefaults
Objectiv-C 函数传入多参数和参数调用方法
-(void)funname:(NSArray*)yourarray;
传入数组
-(void)funname:(NSstring*)st1 : (NSstring*)st2 : (NSstring*)st3;
多参数
以下是调用方法
[self funname:[NSArray arrayWithObjects:[noteList objectAtIndex:2],[noteList objectAtIndex:3],[noteList objectAtIndex:4],nil]];
或
[self funname:[NSString stringWithFormat:@"saaa"] :[NSString stringWithFormat:@"sbbb"] :[NSString stringWithFormat:@"sbbb"]];
完整方法
.h文件
@interface ViewController : UIViewController{
NSString * no;
}
@property(nonatomic,retain)NSString * no;
-(void)setData:(NSString*)aa : (NSString*)bb;
.m文件
- (void)viewDidLoad
{
[super viewDidLoad];
[self setData:[NSString stringWithFormat:@"saaa"] :[NSString stringWithFormat:@"sbbb"]];
NSLog(@"%@",no);
[no release];
// Do any additional setup after loading the view, typically from a nib.
}
-(void)setData:(NSString*)aa : (NSString*)bb
{
no = [[NSString alloc] initWithFormat:@"%@%@",aa,bb];
}
NSArray *sortedArray = [colorRGBt sortedArrayUsingComparator: ^(id obj1, id obj2) {
if ([obj1 integerValue] < [obj2 integerValue]) {
return (NSComparisonResult)NSOrderedDescending;
}
if ([obj1 integerValue] > [obj2 integerValue]) {
return (NSComparisonResult)NSOrderedAscending;
}
return (NSComparisonResult)NSOrderedSame;
}];
objectiv-C 数组内容 大小排序方法
结果是0,23,59,99,103,480,1000或者倒回来1000,480,103,99,59,23,0;
Recent Comments