目的の画像をmyButton.png、1x1透過pngをtransparent.pngとする。 UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"myButton"] style:UIBarButtonItemStylePlain target:aTarget action:anAction]; [item setBackgroundImage:[UIImage imageNamed:@"transparent"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; aViewController.navigationItem.rightBarButtonItem = item; [item rel
I'm guessing I would only use UIKIT_EXTERN if there is a chance of C++ code in my project that may use the variable. Right. This is the primary reason. This happens because C and C++ symbols use different naming conventions. There is a less common reason: UIKIT_EXTERN also specifies default visibility. Note: More generally, "symbol" -- not "variable" since extern could also be applied to constants
スワイプの処理 RootViewController にUIGestureRecognier を左右両方向について登録しておく。 - (void)viewDidLoad { [super viewDidLoad]; : UISwipeGestureRecognizer* swipeGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(didSwipeCell:)]; swipeGesture.direction = UISwipeGestureRecognizerDirectionRight; [self.tableView addGestureRecognizer:swipeGesture]; [swipeGesture release]; swipeGesture = [[UIS
処理が終わったら(サンプルでは2秒間のウェイトが入れてある) contentInsets.top = -60 へ戻してやる。すると最初のヘッダが隠れた表示に戻る。なお contentInsets も UIViewアニメーションの対象なので +[UIView animateWithDuration:aniamations:] を使うとヘッダが隠れるまでがアニメーションになる(逆に使わないと一瞬で切り替わり、やや不自然になる)。 コードではヘッダの表示制御用にメソッドを用意してある。こんな感じ。 - (void)_setHeaderViewHidden:(BOOL)hidden animated:(BOOL)animated { CGFloat topOffset = 0.0; if (hidden) { topOffset = -self.headerView.frame.size.heig
プッシュ通知を実装するときに、「バックグラウンドで通知受けたときはapplication:didFinishLaunchingWithOptions:とapplication:didReceiveRemoteNotification:、どっちが呼ばれるんだっけ?」とかなんだかいつも自信なくなってきてドキュメントを見返したりしてしまうので、ドキュメントと、実際の動作を確認した内容をまとめておきます。 (参考ドキュメント) Local Notification および Push Notification プログラミングガイド(日本語) (英語・最新版) アプリがバックグラウンドで動作中に通知が配信された場合の挙動 この場合、システムは、警告の表示、アイコンのバッジの表示、また、サウンドの再生を行う ことで通知を提示します。 アクションボタンがタップされると、システムはアプリケーションを起動しま
TwitterでViewライフサイクルについて話題になったので、まとめてみました。 @tomohisa @gaolay @replicantnexus6 @t_okada これまではiOS5では呼ばれてましたね。5ではwillUnloadっていう使いドコロのわからないメソッドも追加されてそれも呼ばれてましたし。 — kishikawa katsumiさん (@k_katsumi) 9月 20, 2012 シングルビューの動作 こちらが基本となります。よく勘違いされているのは、ViewDidUnloadは、いつもViewが閉じるときに呼ばれるというものですが、これは間違いで、通常、ViewDidUnloadは呼ばれません。 モーダルビューが呼ばれたとき モーダルビューが呼ばれたときの注意点は、裏にあるビューは、一度UIWindowから削除されて、ViewDidDisappearが走るという点
Full Source code: https://github.com/boctor/idev-recipes/tree/master/RaisedCenterTabBar Problem: Apps like Instagram, DailyBooth and Path™ have what looks like a standard UITabBarController, but the center tab bar is raised or colored. How do we recreate this look? Solution: These tab bars look pretty standard with the exception of the center item, so we’ll start out with a standard UITabBarContro
Responder Chain とは UIResponderオブジェクトの連なり(リンク)のことで、イベント処理の順番を決定するのに使われる。イベントが発生すると、システムは Redponder Chain の順番にしたがって UIResponderオブジェクトを評価する。もし最初の UIResponderオブジェクトでイベント処理が行われない場合は Responder Chain の次の UIResponderオブジェクト へと移り再び評価を行う。イベント処理を行う UIResponderオブジェクトが見つかるまで Responder Chain 上のリンクを辿って評価を続けていく。一旦どこかの UIResponderオブジェクトがイベントを処理するとイベントの伝搬はそこで終わる。Responder Chain 上のどの UIResponderオブジェクトも処理を行わない場合はやがては最
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く