我不明白为什么我的项目不起作用。 我可以打开窗口,但是scrollview不会滚动,这意味着我无法看到我的UI的底部。为什么?我阅读了类似问题的答案,但他们没有帮助我解决我的问题。
这是DETAILVC.H
@interface DetailVC : UIViewController {
IBOutlet UIImageView *iv_main, *iv_ratings;
IBOutlet UITextField *tf_name, *tf_dob, *tf_age, *tf_weight, *tf_height,*tf_birthplace;
IBOutlet UITextView *tv_description;
IBOutlet UIButton *but_movies, *but_edit;
IBOutlet UINavigationBar *navbar;
IBOutlet UIScrollView *scrollView;
}
@property (nonatomic, retain) IBOutlet UIImageView *iv_main, *iv_ratings;
@property (nonatomic, retain) IBOutlet UITextField *tf_name, *tf_dob, *tf_age, *tf_weight, *tf_height, *tf_birthplace;
@property (nonatomic, retain) IBOutlet UITextView *tv_description;
@property (nonatomic, retain) IBOutlet UIButton *but_movies, *but_edit;
@property (nonatomic, retain) IBOutlet UINavigationBar *navbar;
@property (nonatomic, retain) IBOutlet UIScrollView *scrollView;
@end
这是DETAILVC.M
#import "DetailVC.h"
@interface DetailVC ()
@end
@implementation DetailVC
@synthesize iv_main, iv_ratings, tf_age, tf_birthplace, tf_dob, tf_height, tf_name, tf_weight, tv_description, but_edit, but_movies,navbar, scrollView;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
scrollView.contentSize = CGSizeMake(320, 1000);
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
------连接督察
http://s18.postimg.org/qjzrdz9a1/Schermata_2013_08_07_alle_16_47_19.png
------滚动查看属性检查员
http://s8.postimg.org/5eniaq8r9/Schermata_2013_08_07_alle_17_35_04.png
答案 0 :(得分:0)
UIScrollView的框架是否有可能与contentSize具有相同的大小?如果是,UIScrollView会认为它有足够的框架来显示所有内容。