문제

i'm very new to xcode. i've googled this and even serched here and i didn't find exactly what i was looking for. i really wanna get this. especially since it's the most basic thing there is.

so, i have the .h and .m files

i want to DRAG a uiview into the .xib file, i don't want it to be as big as the screen, so i resize it.

now i want to draw a bunch of rectangles INSIDE this view object.

how do i go about doing this?

your help would be greatly appreciated!

도움이 되었습니까?

해결책

So you add a generic UIView then create a subclass of UIView and do your drawing inside the drawRect method.

Then change the class of the UIView to your subclass name in the inspector.

Be sure to #include your header in the app delegate.

That's the basic thing.

For more sophistication, you're going to want to learn to use UIViewController subclasses as well. These are used all over ios.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top