View manipulation problem
View manipulation problem
- Subject: View manipulation problem
- From: ico <email@hidden>
- Date: Tue, 25 May 2010 21:49:37 +0800
Hi All,
I have a little iPhone app which has the following UI:
1. 2 buttons, use to manipulate my model object.
2. 2 switches, let's call them infoSwitch and optionSwitch respectively
3. A custom view, its subview includes 4 UILabel, those labels are used to
display infomation of my model object. Let's call it infoView.
4. Another custom view, includes a slider and textfield which are used to
setup some states of my model objects, and the optionSwitch mentioned above.
Let's call the view as optionView.
5. Yet another custom view, it will show the drawing graph of my model
object according to its state. Let's call it graphView.
The layout I want to show to the user is 2 buttons on top, next line is
infoSwitch, and the next line is optionSwitch. And the next line of course
is my drawing graph of my model object. That's all the user can see at the
beginning. Both switches are set to off when they are loaded. And both
infoView and optionView are transparent. (Alpha value is 0.0).
User will use those 2 buttons to change the basic state of my model object.
And the user can also switch the infoSwith to be on, once this event occurs,
the optionSwitch, optionView and the graphView will slip certain pixel down,
and the infoView will be showed right below to the infoSwith and above to
the optionSwitch. Same thing should happen to the optionView. Once the user
switch the optionSwitch to be on, the graphView will slip certain pixel
down, and the optionView should be showed to the user where is below to the
optionSwitch and is above to the graphView.
That's what I want to implement. I have a problem regarding to this. In
order to make the user see what I expect, the optionView will be layout on
top of the infoView at the beginning. They are overlap. Hence the optionView
will become the subview of the infoView. However, I will set the infoView
alpha to 0.0 in the awakeFromNib method, then its subview includes
optionView will be transparent as well even I set optionView alpha to 1.0,
how to fix this? And since optionView is the subview of infoView, so when I
move the optionView down, it can not be moved out of optionView anyway. Same
thing happen to optionSwitch because optionSwitch is overlap with infoView,
so if I make infoView transparent, so is optionSwitch. If I put all of these
question into one statement, I guess it will be how to make each custom view
independent even they are overlap in the interface builder, that is I don't
want them to be superview and subview relationship. I want to handle them
separately. Do I approach it the right way? Also, if I relocate the
optionView down to certain pixcel, I guess it will no be displayed on the
screen because it is located outside of the infoView(its superview). Can
anyone suggest me a solution for this? Thank you.
best regards,
ico
--
==========================
Life isn't about finding yourself.
Life is about creating yourself.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden