[objective-c]UISliderのつまみをアニメーションさせる
UISliderのつまみをアニメーションさせる
[UIView animateWithDuration:0.3f animations:^{ [slider setValue:2.0 animated:YES]; } ];
UISliderのつまみをアニメーションさせる
[UIView animateWithDuration:0.3f animations:^{ [slider setValue:2.0 animated:YES]; } ];
UIButtonのラベルをフォントサイズ自動縮小にする
UILabel*innerLabel= btn.titleLabel; innerLabel.adjustsFontSizeToFitWidth=YES; innerLabel.lineBreakMode=NSLineBreakByClipping;//これがないとフォントが自動縮小しない innerLabel.numberOfLines=3;
テーブルのカラム名を取得
$this->Model->getColumnTypes();
Controller
$columnTypes=$this->SystemTest->getColumnTypes(); $columnNames=array_keys($columnTypes); $this->set('columnTypes', $columnTypes); $this->set('columnNames', $columnNames);
View
columnTypes<br/> <?php $tmp=var_export($columnTypes,true); echo str_replace("\n", "<br/>", $tmp); ?> <br/><br/> columnNames<br/> <?php $tmp=var_export($columnNames,true); echo str_replace("\n", "<br/>", $tmp); ?>
UIButtonのタイトルの位置,サイズ調整
UIButton*btn=[UIButton buttonWithType:UIButtonTypeCustom]; [btn setTitleEdgeInsets:UIEdgeInsetsMake(6.0f, 7.0f, 8.0f, 9.0f];//top margin:6.0, left margin:7.0, bottom margin:8.0, right margin:9.0
バンドルしたテキストファイルを読み込む
NSString *path = [[NSBundle mainBundle] pathForResource:@"testdata" ofType:@"json"]; NSError* error; NSString* dataString = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:&error];
UIButtonのラベルを複数行にする
testbutton.layer.borderWidth=1.0; [testbutton setTitle:@"あいうえお\nかきくけこ" forState:UIControlStateNormal]; UILabel*innerLabel= testbutton.titleLabel; innerLabel.numberOfLines=0; innerLabel.frame=CGRectMake(0, 0, testbutton.frame.size.width, testbutton.frame.size.height);
メールを起動する
NSURL *nsurl = [NSURL URLWithString:@"mailto:your@mail.com"]; [[UIApplication sharedApplication] openURL:nsurl];
ツイートボタンのdata-urlのurlがリダイレクト処理をしていたら
ツイート数はどのurlに対してカウントアップするのだろうか
答え:リダイレクト先でした
サンプル:/test/78/
サンプルの(1)はphpで(2)へリダイレクトする。
/test/78/access/index.php
<?php header('Location:/test/78/redirected/'); ?>
サンプルの(1)でツイートすると(2)のツイート数が増える。
Safariで指定のURLを開く
NSURL *nsurl = [NSURL URLWithString:@"http://google.co.jp/"]; [[UIApplication sharedApplication] openURL:nsurl];