2014-01-28 2 views
0

I가 내가 (이미지가 스토리 보드에 계층 구조를 설명 스크롤 뷰를 구현 한 다음 응용 프로그램 : 중증으로 전자 내가 자동 레이아웃을 꺼져스크롤 뷰 스크롤되지

Hierarchy of storyboard

을, 여기 게시물은이 문제를 만들고 표시하는 것 여기

내 .H 파일입니다.

#import <UIKit/UIKit.h> 
#import <MessageUI/MessageUI.h> 
#import <MessageUI/MFMailComposeViewController.h> 
#import <AssetsLibrary/ALAsset.h> 
#import <AssetsLibrary/ALAssetRepresentation.h> 
#import <ImageIO/CGImageSource.h> 
#import <ImageIO/CGImageProperties.h> 
#import <CoreLocation/CoreLocation.h> 



@interface DobInAHoonViewController : UIViewController<UIImagePickerControllerDelegate, UINavigationControllerDelegate, MFMailComposeViewControllerDelegate, UITextFieldDelegate, CLLocationManagerDelegate> 
{ 
    IBOutlet UIPickerView *vehiclePickerView; 
    UIImagePickerController *picker1; 
    UIImagePickerController *picker2; 
    UIImage *image; 
    IBOutlet UIImageView *imageView; 
    CLLocationManager *locationManager; 
    CGFloat animatedDistance; 

} 
@property (strong, nonatomic) IBOutlet UIImageView *BackgroundImage; 
@property (strong, nonatomic) IBOutlet UIScrollView *scrollView; 
@property (strong, nonatomic) NSString *Latitude; 
@property (strong, nonatomic) NSString *longditute; 
@property (strong, nonatomic) NSArray *toRecipients; 
@property (strong, nonatomic) ALAssetsLibrary *assetsLibrary; 
@property (strong, nonatomic) NSMutableArray *groups; 


@property (nonatomic, retain) IBOutlet UITextField *vehilceMake; 
@property (nonatomic, retain) IBOutlet UITextField *vehilceColour; 
@property (nonatomic, retain) IBOutlet UITextField *regoNumber; 
@property (nonatomic, retain) IBOutlet UITextField *location; 
@property (nonatomic, retain) IBOutlet UITextField *additionalInfo; 
@property (nonatomic, retain) IBOutlet UITextField *vehicleType; 


- (IBAction)takePhoto; 
-(IBAction)chooseExisting; 
-(IBAction)actionEmailComposer; 
-(IBAction)textFileReturn:(id)sender; 
-(IBAction)DismissKeyboard:(id)sender; 
@end 

내하는 .m 파일 :

#import "DobInAHoonViewController.h" 

@interface DobInAHoonViewController() 



@end 

@implementation DobInAHoonViewController 
@synthesize BackgroundImage; 
@synthesize vehilceColour; 
@synthesize vehilceMake; 
@synthesize regoNumber; 
@synthesize Latitude; 
@synthesize location; 
@synthesize longditute; 
@synthesize additionalInfo; 
@synthesize toRecipients; 
@synthesize assetsLibrary; 
@synthesize groups; 
@synthesize vehicleType; 
@synthesize scrollView; 



static const CGFloat KEYBOARD_ANIMATION_DURATION = 0.3; 
static const CGFloat MINIMUM_SCROLL_FRACTION = 0.2; 
static const CGFloat MAXIMUM_SCROLLFRACTION = 0.8; 
static const CGFloat PORTRAIT_KEYBOARD_HEIGHT = 216; 
static const CGFloat LANDSCAPE_KEYBOARD_HEIGHT = 140; 




-(BOOL)textFieldShouldReturn:(UITextField *)textField 
{ 
    [vehilceMake resignFirstResponder]; 
    [vehilceMake resignFirstResponder]; 
    [vehilceColour resignFirstResponder]; 
    [location resignFirstResponder]; 
    [additionalInfo resignFirstResponder]; 
    [regoNumber resignFirstResponder]; 
    return YES; 
} 


- (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. 

    [self.scrollView setScrollEnabled:YES]; 
    [self.scrollView setContentSize:(CGSizeMake(320, 1000))]; 


    locationManager = [[CLLocationManager alloc]init]; 
    toRecipients = [[NSArray alloc]initWithObjects:@"[email protected]", nil]; 

    BackgroundImage.alpha = 0.3; 
    static int emergAlertCounter; 
    if (emergAlertCounter <1) { 


    UIAlertView *emergencyAlert = [[UIAlertView alloc] 
           initWithTitle:@"NOTE" message:@"Do not endanger your life to dob in a hoon. If your life is threatened, or you are reporting an emergency situation, exit this app and dial '000' IMMEDIATLY!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; 
    [emergencyAlert show]; 
     emergAlertCounter = emergAlertCounter+1; 
    } 
} 
어떤 이유로 앱을 실행할 때 스크롤보기가 스크롤되지 않습니다. 인터페이스 빌더에서 스크롤 할 속성을 설정했습니다.

의견을 보내 주시면 대단히 감사하겠습니다.

답변

1

스크롤보기가 320x1000보다 작고 삽입 된보기가 320x1000보다 큰지 확인해야합니다.

관련 문제