스토리 보드를 사용하여 많은 하위 항목이 UIView
포함 된 을 만들고 UIScrollView
있습니다. 이러한 하위 항목은에 대한 UIImageView
배경 이미지로 사용중인 UIScrollView
, UILabels
프로그래밍 방식으로 채운 일련의 항목 및 UITableViews
호출 된 라이브러리 클래스 집합에서 얻은 데이터로 채운 일련의 항목으로 구성됩니다 . UIScrollView
사용자가 여러보기를 표시하지 않고도 모든 정보를 스크롤 할 수 있도록 이 모든 것을 내에서 원합니다 . 여기에서 많은 게시물을 검색하고 많은 제안을 사용했지만보기 스크롤을 성공적으로 수행하지 못하고 사용자가 내가 제시하려는 모든 데이터를 볼 수 있도록 허용하지 못했습니다.
다음은 스토리 보드의 스크린 샷과 내 속성 검사기의 샷입니다. UIScrollView
I'll also provide the .h and .m files
weatherController.h
#import <UIKit/UIKit.h>
#import "WeatherParser.h"
#import "WeatherLocation.h"
#import "WeatherImg.h"
#import "WeatherWind.h"
#import "ForcastDay.h"
#import "ForecastItem.h"
#import "Condition.h"
#import "Atmo.h"
#import "Astro.h"
@class WeatherParser;
@class WeatherParserDelegate;
@class WeatherLocation;
@class WeatherImg;
@class WeatherWind;
@class ForcastDay;
@class ForecastItem;
@class Condition;
@class Atmo;
@class Astro;
@interface weatherController : UIViewController <UITableViewDataSource,UITableViewDelegate,WeatherParserDelegate>{
WeatherParser * _rssParser;
bool loadingEvents;
}
@property (nonatomic, retain) WeatherParser * rssParser;
@property bool loadingEvents;
@property (retain, nonatomic) IBOutlet UIScrollView *scrollView;
@property (weak, nonatomic) IBOutlet UILabel *cityLabel;
@property (weak, nonatomic) IBOutlet UILabel *state_countryLabel;
@property (weak, nonatomic) IBOutlet UILabel *currHighLabel;
@property (weak, nonatomic) IBOutlet UILabel *currLowLabel;
@property (weak, nonatomic) IBOutlet UILabel *currTempLabel;
@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@property (weak, nonatomic) IBOutlet UIImageView *logoImageView;
@property (weak, nonatomic) IBOutlet UILabel *logoLabel;
@property (weak, nonatomic) IBOutlet UITableView *forecastTableView;
@property (weak, nonatomic) IBOutlet UITableView *atmoTableView;
@property (weak, nonatomic) IBOutlet UITableView *windTableView;
@property (weak, nonatomic) IBOutlet UITableView *astroTableView;
@property (weak, nonatomic) IBOutlet UIBarButtonItem *sidebarButton;
@property (nonatomic, retain) NSMutableArray *forecastDays;
@property bool logoSet;
@end
and here's my weatherController.m file. I'm going to only add the viewDidLoad
method which is the only method containing code regarding my UIScrollView
.
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
_scrollView.delegate = self;
// self.scrollView.frame = CGRectMake(0, 0, 320.0f, 480.0f);
self.scrollView.contentSize =CGSizeMake(320.0F, 480.0F); //(320, 1210)];
[_scrollView setScrollEnabled:YES];
}
I would appreciate any help regarding what it is I'm either doing wrong or missing. If I set up my frame
and contentSize
to the following:
self.scrollView.frame = CGRectMake(0, 0, 320.0f, 480.0f);
self.scrollView.contentSize =CGSizeMake(320.0F, 1210.0F);
I do get the UIScrollView
to scroll, but the image for the background is only the size of the frame, and none of the rest of the child content on the UIScrollView
is displayed. It seems like it's allowing me to scroll but I'm only able to view the content that is viewable within the frame
.
Again, thank you in advance for any help offered.
주석에서 알 수 있듯이 일반적으로 UIScrollView 내에 UITableView를 배치하는 것은 좋지 않습니다. 허용되는 해결책이 될 때와 장소가 있기 때문에 나는 당신에게 너무 어렵지 않을 것입니다. 이번이 지금인지 아닌지 판단하도록하겠습니다.
여전히 완전히 이해하지 못하는 이유로 UIScrollView는 UIScrollView가 스크롤 할 수있는 크기의 단일 UIView에 전체 콘텐츠를 포함하면 예상 한대로 작동합니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다