Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a Boundary outline in UIView of Iphone.Please Read Description

Tags:

iphone

uiview

I want to make a rectangle Boundary and to insert a UITextView and two buttons in that rectangle .If i making the rectangle by adding a subView in a from UIView class than I am unable to interact with the controls in the rectangle area which i inserted in the subview from Interface builder.

I am attaching a screen for that

http://www.algoworks.com/images/img065842101.jpg

In this image I have to make a rectangle and have to insert a text view and two Ui buttons.If I am making rectangle from UIView and adding in View Controller than the controls added in this subview from Interface builder doesn't responds.So I have to add these controls Programitically which create this task very tough.

Please Provide me a solution to make boundary of rectangle and than to add Controls.

like image 360
Sanchay Avatar asked Feb 02 '10 08:02

Sanchay


2 Answers

Just put all the controls in a container UIView and set the borderWidth and borderColor properties of the container view's layer.

like image 100
Ole Begemann Avatar answered Oct 24 '22 18:10

Ole Begemann


Ole Begemann is correct in his post of borderWidth. One important addition though is that you need the following line.

 #import <QuartzCore/QuartzCore.h>

mj

like image 44
mj_ Avatar answered Oct 24 '22 19:10

mj_