TPKeyboardAvoidingScrollView无法正常工作

时间:2014-03-29 21:25:30

标签: ios uiscrollview

您好我在github中找到了TPKeyboardAvoidingScrollView,我按照说明进行了操作,但它没有工作

#import "ajouterBilanViewController.h" 
#import "TPKeyboardAvoidingScrollView.h"

@interface ajouterBilanViewController ()

@end

@implementation ajouterBilanViewController
@synthesize scroll;
- (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.
}
- (void)didReceiveMemoryWarning
{  
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end

我在我的xib中添加了一个滚动视图,并使用TPKeyboardAvoidingScrollView更改了uiscrollview 但没有任何效果。

#import <UIKit/UIKit.h>
@class TPKeyboardAvoidingScrollView;
@interface ajouterBilanViewController : UIViewController
 @property (weak, nonatomic) IBOutlet TPKeyboardAvoidingScrollView *scroll;
 @end

1 个答案:

答案 0 :(得分:3)

以下是如何使其发挥作用,

希望这会对你有所帮助.. You need to set your custom class as shown

REST将由TPKeyboardAvoidingScrollView为您管理