English 中文(简体)
我如何看待主计长的违约观点?
原标题:How should I draw on ViewController s default View?

XCode 4.2 (the only version of XCode I ve ever used) creates a ViewController with a default View property.

我看不到这一缺省观点的代码,因此我无法引用(因为我无法查阅)。 这是否正确?

综上所述,我不能 draw。 如果我想利用窗口,我:

  1. Add a subview to the default View and then draw (via drawRect) on the subview? or
  2. Replace the default View with one that I create and can therefore draw on via drawRect?

这不是如何做到这一点的问题,我想知道什么是最佳方法。 感谢。

问题回答

如果你认为有必要根据您的意见制定惯例,那么你应当界定自己的习惯。 UIView 班级,在校正

现在,你要么采取办法1或2, 取决于你的意愿。 两者都是完全合理的。

例如,你想做你的习惯,但同时也表现出某种控制(例如,清点,重新编造,等等),因此,我认为,如果你有根本观点认为,你会增加习惯观点,而另一种看法认为是分观点的话,那会更好。 但是,这只是一个例子,它取决于你努力完成的工作。

希望有助于......





相关问题
How do you create UIBarButtonItems with a radio interface?

I have a UIToolbar that needs three buttons in a radio style, meaning that of the three, only one button can be pushed at a time. The documentation makes reference to the possibility of setting up ...

iPhone settings bundle

I want to allow the user to enter a valid date using the iPhone’s settings application. I have experimented with many of the PreferenceSpecifiers data node types including date. I have two issues: ...

Circular #import/@class problem in ObjectiveC

I m going to use an example to properly illustrate my confusion. I can t quite wrap my head around this. In Cocoa touch, we have UIViewController and its subclass, UINavigationController. Now, UIVC ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Cocoa-Touch: issue looping MPMoviePlayerController

I have an app which has to load some data at startup, so I want to display a splash-screen animation. I m using the MPMoviePlayerController to play a m4v file. The movie has it s background set to [...

Iphone sequential animation with setAnimationDelay

I m trying to chain animation events. The application I m coding for work has a multiple choice quiz. First you pick your multiple choice answer. The quiz view fades away. Then a label ("correct" or "...

热门标签