Domanda

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!

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top