1
Q
圖像的縮略圖網格
A
回答
1
這是我簡單的網格視圖應用
- (void)viewDidAppear:(BOOL)animated {
[[Grid_ViewAppDelegate sharedAppDelegate] hideLoadingView];
temp = temp+1;
if (temp ==1){
NSLog(@"temp:%d",temp);
int n = 20; //Numbers of array;
NSArray *t = [[NSArray alloc] initWithObjects:@"calpie.gif",@"chrysler_electric.png",@"chrysler_fiat_cap.gif",@"cleanup.gif",@"ecylindri.gif",@"elect08.png",@"globe.gif",@"heat.gif",@"insur.gif"
,@"jobs.gif",@"office.gif",@"opec1.gif",@"orng_cap.gif",@"poll.gif",@"pollen.gif",@"purbar.gif",@"robinson.gif",@"robslink_cap.gif",@"scot_cap.gif",@"shoes.gif",nil];
myScrollView.contentSize = CGSizeMake(320, 460+n*2);
myScrollView.maximumZoomScale = 4.0;
myScrollView.minimumZoomScale = 1;
myScrollView.clipsToBounds = YES;
myScrollView.delegate = self;
NSString *mxiURL = @"http://meta-x.com/biflash/images/";
int i =0,i1=0;
while(i<n){
int yy = 4 +i1*79;
for(int j=0; j<4;j++){
if (i>=n) break;
CGRect rect;
rect = CGRectMake(4+79*j, yy, 75, 75);
UIButton *button=[[UIButton alloc] initWithFrame:rect];
[button setFrame:rect];
NSString *nn = [mxiURL stringByAppendingString:[t objectAtIndex:i]];
UIImage *buttonImageNormal=[UIImage imageWithData: [NSData dataWithContentsOfURL: [NSURL URLWithString: nn]]];
[button setBackgroundImage:buttonImageNormal forState:UIControlStateNormal];
button.tag =i;
[button addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside ];
//[self.view addSubview:button];
[myScrollView addSubview:button];
//[buttonImageNormal release];
[button release];
i++;
//
}
i1 = i1+1;
//i=i+4;
}
}
}
中的AppDelegate
+ (Grid_ViewAppDelegate *)sharedAppDelegate
{
return (Grid_ViewAppDelegate *)[UIApplication sharedApplication].delegate;
}
- (void)showLoadingView
{
if (loadingView == nil)
{
loadingView = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 480.0)];
loadingView.opaque = NO;
loadingView.backgroundColor = [UIColor grayColor];
loadingView.alpha = 0.5;
UIActivityIndicatorView *spinningWheel = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(142.0, 222.0, 37.0, 37.0)];
[spinningWheel startAnimating];
spinningWheel.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
[loadingView addSubview:spinningWheel];
[spinningWheel release];
CGRect label = CGRectMake(142.0f, 255.0f, 71.0f, 20.0f);
lblLoading = [[UILabel alloc] initWithFrame:label];
lblLoading.textColor = [UIColor whiteColor];
lblLoading.font = [UIFont boldSystemFontOfSize:14];
// UILabel
lblLoading.backgroundColor =[UIColor clearColor];
[lblLoading setText:@"Loading..."];
//[lblLoading setTextAlignment:UITextAlignmentCenter];
[loadingView addSubview:lblLoading];
}
[window addSubview:loadingView];
}
- (void)hideLoadingView
{
[loadingView removeFromSuperview];
}
肯定,如果ü應用此邏輯。你成功了
相關問題
- 1. 爲圖像網格創建縮略圖
- 2. bootstrap3縮略圖網格
- 3. 圖像縮略圖
- 4. 圖像縮略圖
- 5. facebook視頻縮略圖圖像網址?
- 6. 縮略圖網格與偶爾的大圖像
- 7. 將圖像縮略圖添加到網格中的佈局?
- 8. 將圖像縮略圖添加到ExtJS中的網格行
- 9. 靈活的縮略圖網格與css
- 10. mkmapview縮略圖圖像
- 11. 圖像和縮略圖
- 12. 圖像適合縮略圖
- 13. PHP縮略圖圖像
- 14. 安排圖像縮略圖
- 15. UIScrollView和圖像縮略圖
- 16. 圖像縮略圖ASP.NET
- 17. 檢索圖像縮略圖
- 18. Facebook縮略圖圖像
- 19. 純CSS圖像縮略圖
- 20. 調整Boostrap'縮略圖網格系統'
- 21. 圖像縮放/成長在縮略圖
- 22. 像SlickGrid的DataView一樣顯示縮略圖網格
- 23. 不縮小圖像大小的縮略圖圖像
- 24. ios dropbox,在表格視圖中加載圖像的縮略圖
- 25. 負載平衡和Web圖像/縮略圖/縮略圖
- 26. Umbraco中的.gif圖像的縮略圖
- 27. 帶縮略圖和網格中的Bootstrap的垂直居中圖像
- 28. 圖庫HTML圖像顯示縮略圖
- 29. 如何使用JSP在我的網頁上填充圖像縮略圖(圖像網格)
- 30. 刮我的網站上的圖像顯示縮略圖(Rails)
謝謝。這是什麼用於[[Grid_ViewAppDelegate sharedAppDelegate] hideLoadingView]; – jarryd 2011-02-17 13:35:15