I thought that it is going to be an easy thing but I am stuck with scrolling. Height of my UIScrollView
is equal to the hight sets in my code (700) . I ticked off Use Autolayout
. And it scrolls but do not show fully text UITextView
. It is non-editable text, just description of town. It is a large text. I want to make some autofix for UIScrollView
according to the long of the UITextView
. Don`t want free space at the end of UITextView.
Thank you
Right now it looks something like this:
DetailViewController.h
#import <UIKit/UIKit.h>
#import "Parse/Parse.h"
#import "TableViewController.h"
@interface DetailViewController : UIViewController < UITextFieldDelegate, UITextViewDelegate, UIScrollViewDelegate>
@property (strong, nonatomic) IBOutlet UITextView *PopisMesta;
@property (nonatomic, strong) PFObject *detailItem;
@property (nonatomic,strong) IBOutlet UILabel *deatailedlabel;
@property (nonatomic, strong) IBOutlet UILabel *pocetobyv;
@property (strong, nonatomic) IBOutlet UIImageView *imageviewsec;
@property (strong, nonatomic) IBOutlet UIScrollView *viewScroller;
@end
DetailViewController.m
#import "DetailViewController.h"
#import "Parse/Parse.h"
#import <SDWebImage/UIImageView+WebCache.h>
@interface DetailViewController ()
@end
@implementation DetailViewController
@synthesize PopisMesta;
@synthesize deatailedlabel;
@synthesize pocetobyv;
@synthesize imageviewsec;
@synthesize viewScroller;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[viewScroller setScrollEnabled:YES];
[viewScroller setContentSize:CGSizeMake(320, 700)];
self.PopisMesta.text = [self.detailItem objectForKey:@"PopisMesta"];
self.deatailedlabel.text = [self.detailItem objectForKey:@"MestoName"];
self.pocetobyv.text = [self.detailItem objectForKey:@"PocetObyv"];
[self.imageviewsec setImageWithURL:[NSURL URLWithString:[self.detailItem objectForKey:@"ImageURL"]]
placeholderImage:[UIImage imageNamed:@"placeholder.png"]];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end