Using storyboard, static cells, in cellForRowAtIndexPath: the line UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; always returns nil. I have checked the following: Identifier of the cell is correctly set in IB/Storyboard and I use the same identifier in code. I verified this many times. I have not instantiated the view controller elsewhere (which was the prob
UITextView では dataDetectorTypes を設定することでデータタイプに応じて自動的にクリック可能なリンクとして表示してくれます。 例えば下記のようにしていすると、URLが含まれていた場合、タップ可能なリンクとして表示されます。 cell. tweetTextView. dataDetectorTypes = UIDataDetectorTypeLink; 他にも次のようなデータタイプが用意されていて、電話番号、住所、イベント(日付や「今週」「今夜」など)っぽい文字列をリンクにすることができます。 typedef NS_OPTIONS(NSUInteger, UIDataDetectorTypes) { UIDataDetectorTypePhoneNumber = 1 << 0, // Phone number detection UIDataDetectorTyp
ついにiOS 6がリリースされましたね。iOS 6では、また数多くの機能が追加されました。ユーザー目線での新機能もさることながら、個人的には開発者にとって嬉しい新機能 Collection View に注目しています。 Collection Viewとは Collection Viewとは、一言で言えば縦横方向にセルを並べることができるTable Viewのようなものです。UICollectionViewControllerを用いて画面を作成し、セルの中身は、UITableViewControllerと同様にDataSourceを使って指定します。 各セルのサイズは一定である必要はなく、また、セル間の最低間隔を指定しておくことで、レイアウトが自動で計算されキレイに配置されます。 かなり少ないコード量で、以下のスクリーンショットのようなUIを実現することが可能です。もちろん、デバイスの向きが
前回、UICollectionViewを構成するクラス群の役割と、その簡単な利用方法について見ていきました。今回は、前回に続いてカスタムレイアウトコンポーネントを作成したいと思います。 UICollectionViewLayoutのサブクラスを作成 カスタムレイアウトコンポーネントを作成する際には、UICollectionViewLayoutクラスを継承したレイアウトクラスを作成します。UICollectionViewLayoutのサブクラスでは、以下のメソッドをオーバーライドして実装する必要があります。 collectionViewContentSize UICollectionView内の要素を配置するコンテンツ部のサイズを返すメソッドです。UIScrollViewのcontentSizeプロパティと同じく、スクロール領域の範囲をコントロールします。 layoutAttributesF
Multi Selectable UITableView UITableViewは、セルの複数選択をサポートしてません。そこで、編集モード時にセルの複数選択を可能にするプログラムを作成してみます。 ”編集”ボタンをクッリックすると編集モードに入り、セルのクリックでチェックマークがつくようにする。また、編集モード時はツールバーを表示させる。 実装 編集モード時にセルにチェックマーク画像を付加するように UITableViewCell をカスタマイズし、ツールバーを表示させます。 ツールバー 通常、隠れた状態で編集モードの際に表示されるようにします。また、チェックしたセルに対してのアクションを配置します。削除ボタンを配置します。セルがチェックされるまで、削除ボタンは非アクティブにしておきます。 // Toolbar self.navigationController.toolbar.tintC
iOS Customizing Navigation Bar and Status Bar in iOS 7 Simon Ng 4th Oct '13 104 Like many of you, I have been very busy upgrading my apps to make them fit for iOS 7. The latest version of iOS introduces lots of visual changes. From a developer’s perspective, the navigation bar and status bar are two noticeable changes that need to cater. The status bar is now transparent, that means the navigation
I'm a newbie with the Storyboard and so I have some difficulties... I have created a TableViewController and I would like to customize the Cell Prototype. In the Cell Prototype I have added several Labels I would like to customize with my own class which inherits from UITableViewCell (AreaListCell). In the Storyboard, for the Cell Prototype I have configured the Custom Class with "AreaListCell" an
Just use a prototype cell as your section header and / or footer. add an extra cell and put your desired elements in it. set the identifier to something specific (in my case SectionHeader) implement the tableView:viewForHeaderInSection: method or the tableView:viewForFooterInSection: method use [tableView dequeueReusableCellWithIdentifier:] to get the header implement the tableView:heightForHeader
iOS5.0以上であれば、UISplitViewControllerDelegateに、次のコードを書き足すだけで、デバイスが縦のときにもUISplitViewを2ペインにできます。 - (BOOL)splitViewController:(UISplitViewController *)svc shouldHideViewController:(UIViewController *)vc inOrientation:(UIInterfaceOrientation)orientation { return NO; } 右側のDetailViewが狭くなるのがやはり気になるので、左側のMasterViewの表示/非表示を切り替えられるボタンを付けたら使いやすくなるような気がするのですが、このやり方は調査中です。 splitViewController:shouldHideViewContro
iPadでのモーダルビューで表示される各タイプのサイズについて。 何かの処理中でモーダル表示中のビューコントローラー全体をマスクしたいことがたまにあり、その度にサイズを忘れて調べるのでメモしておく。 iPadでのモーダルビューは3種類+1種類指定可能。 +1種類は(UIModalPresentationCurrentContext:親ビューコントローラーと同じものという指定) 詳細は「iPadヒューマンインターフェースガイドライン」の項「モーダルビュー」を参照。 モーダルビューの種類 モーダルビューの種類はビューコントローラのmodalPresentationStyleプロパティにそれぞれ下記のように指定する事が可能。 ・フルスクリーン(UIModalPresentationFullScreenを指定する) 文字通り、フルスクリーンサイズ。 ・Page Sheet(UIModalPrese
iOS/iPhone/iPad/MacOSX プログラミング, Objective-C, Cocoaなど locationInView: の引数に安易に nil を渡していたら画面回転時に痛い目にあったのでメモしておく。 タッチ位置の座標系-[UITouch locationInView:] の引数を nil とすると Windowの座標系でタッチ位置が取得できる。 [参考情報] UITouch Class Reference より引用: Parameters view The view object in whose coordinate system you want the touch located. A custom view that is handling the touch may specify self to get the touch location in its
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く