Skip to content
Browse files

Added 1px line at top of HPGrowingTextView as border. Modified scroll…

… indicator insets of HPGrowingTextView so that the scroll bar does not collide with the curved holder image. Changed the background to white in the example view controller so that the border is visible.
  • Loading branch information...
1 parent c652a9d commit cfc7776acba711eb7149914b577e6cbea1865ac8 @joepasq joepasq committed with Aug 22, 2011
Showing with 11 additions and 1 deletion.
  1. +10 −0 class/HPGrowingTextView.m
  2. +1 −1 example/Classes/GrowingTextViewExampleViewController.m
View
10 class/HPGrowingTextView.m
@@ -54,13 +54,23 @@ - (id)initWithFrame:(CGRect)frame {
internalTextView.font = [UIFont fontWithName:@"Helvetica" size:13];
internalTextView.contentInset = UIEdgeInsetsZero;
internalTextView.showsHorizontalScrollIndicator = NO;
+ internalTextView.scrollIndicatorInsets = UIEdgeInsetsMake(8, 0, 8, 0);
internalTextView.text = @"-";
[self addSubview:internalTextView];
UIView *internal = (UIView*)[[internalTextView subviews] objectAtIndex:0];
minHeight = internal.frame.size.height;
minNumberOfLines = 1;
+ //Add a 1px line at the top of the view.
+ r.origin.y = -1;
+ r.size.height = 1;
+ UIView *tempLineView = [[UIView alloc] initWithFrame:r];
+ tempLineView.backgroundColor = [UIColor lightGrayColor];
+
+ [self addSubview:tempLineView];
+ [tempLineView release];
+
animateHeightChange = YES;
internalTextView.text = @"";
View
2 example/Classes/GrowingTextViewExampleViewController.m
@@ -53,7 +53,7 @@ -(id)init
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
self.view = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease];
- self.view.backgroundColor = [UIColor grayColor];
+ self.view.backgroundColor = [UIColor whiteColor];
textView = [[HPGrowingTextView alloc] initWithFrame:CGRectMake(0, 0, 320, 100)];
textView.minNumberOfLines = 1;

0 comments on commit cfc7776

Please sign in to comment.
Something went wrong with that request. Please try again.