Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to customize View to combine UITextView and UITextField?



iPhone SDK
----------

Until an announcement is made otherwise, developers should be aware
that the iPhone SDK is still under non-disclosure (section 5.3 of the
iPhone Development Agreement). It can't be discussed here, or anywhere
publicly. This includes other mailing lists, forums, and definitely
blogs.

This situation is somewhat different than a Mac OS X release, in that
a Mac OS X release includes a copy of the developer tools with the
distribution. The iPhone OS 2.0 release on devices and as an upgrade
does _not_ include the development tools. As a result, the SDK is not
automatically considered public because the release has occurred.

Section 5.3 of the iPhone Development Agreement remains in force at
this time, and will so remain until iPhone Developer Program members
are specifically and personally notified by an authorized
representative of Apple.

Le 19 juil. 08 à 16:27, 张志明 a écrit :

I'd like to include one UITextView and one TextField in the headsection of tableView. So I subclass UIView and tried to override the drawRect method. I read the reference guide of UITextField drawRect method, "You should not call this method directly." How can I include a UiTextField in my customized UIView?
when I called method drawInRect, it broke, please kindly find my code as follows.
And I found UITextView has no drawTextInRect, I called drawRect instead, but it did not work and I had no output.



- (void)drawRect:(CGRect)rect {
// Drawing code
UIImage *myImage = [UIImage imageNamed:@"zzm_o.png"];
[myImage drawInRect:CGRectMake(0, 0, 80, 60)];
UILabel *labelTest = [[[UILabel alloc] initWithFrame: CGRectMake(0, 50, 200, 20)] autorelease];
labelTest.font = [UIFont systemFontOfSize: 15.0];
labelTest.textAlignment = UITextAlignmentLeft;
labelTest.textColor = [UIColor blueColor];
labelTest.backgroundColor = [UIColor whiteColor];
labelTest.text = @"Test Label";
//[labelTest drawTextInRect:CGRectMake(0, 50, 80, 30)];


/*UITextField *aTextField = [[UITextField alloc] initWithFrame:CGRectMake(0, 50, 200, 20)];
aTextField.borderStyle = UITextBorderStyleBezel;
aTextField.textColor = [UIColor whiteColor];
aTextField.font = [UIFont systemFontOfSize:15.0];
aTextField.placeholder = @"<enter email>";
aTextField.backgroundColor = [UIColor blackColor];


aTextField.keyboardType = UIKeyboardTypeDefault;
aTextField.returnKeyType = UIReturnKeyDone;
aTextField.delegate =self;


aTextField.clearButtonMode = UITextFieldViewModeWhileEditing; // has a clear 'x' button to the right
[aTextField drawTextInRect: CGRectMake(0, 50, 80, 30)];*/


UITextView *commentBodytextView = [[[UITextView alloc] initWithFrame:CGRectMake( 0, 0, 200, 100)] autorelease];
commentBodytextView.textColor = [UIColor whiteColor];
commentBodytextView.font = [UIFont systemFontOfSize:15.0];
commentBodytextView.backgroundColor = [UIColor blackColor];
//commentBodytextView.delegate = self;
//textView.backgroundColor = [UIColor whiteColor];
commentBodytextView.scrollEnabled = YES;
//commentBodytextView.opaque = YES;
//commentBodytextView.alpha = 1.0;


commentBodytextView.text = @"Now is the time for all good people to come to serve their country.\n\n\nNow is the time for all good people to come to serve their country.";

commentBodytextView.editable = NO;
[commentBodytextView drawRect:CGRectMake( 0, 0, 200, 100)];


UIFont *font = [UIFont boldSystemFontOfSize:20]; [[UIColor whiteColor] set]; NSString *string = @"Molinker Test!"; [string drawAtPoint:CGPointMake(0, 65) withFont:font];



}




_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >How to customize View to combine UITextView and UITextField? (From: 张志明 <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.