Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
iPhone アプリのコードにUIView(つまり)を描画しました。UIButton
UIView
UIButton
今度はiPad版を開発したいのですが、iPhoneとiPadは画面サイズが違うので、UIViewサイズが違うはずです。ビューをプログラムで処理するにはどうすればよいですか?
ユニバーサル iOS アプリの場合、提供しているデバイスを確認し、それに応じてビューを描画します
したがって、View Controller で:: を使用します。
-(void)viewWillAppear:(BOOL)animated { if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { //draw accordingly to your layout for iPad } else { //iphone layout } }