久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

UIImage 在開始時不適合 UIScrollView

UIImage Is Not Fitting In UIScrollView At Start(UIImage 在開始時不適合 UIScrollView)
本文介紹了UIImage 在開始時不適合 UIScrollView的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有一張像這樣的圖片:

I have an image like:

當我將圖像加載到 uiimageview,然后作為子視圖添加到 uiscrollview 時,開始時圖像顯示如下:

When I load the image to uiimageview and then adding as a subview to uiscrollview, at start the image is showing like:

問題是我想在開始時看到所有適合屏幕的圖像,但它顯示已經縮放.有沒有辦法處理這個請幫忙...

The problem is I want to see all the image fit to screen at start but it is showing already zoomed. Is there a way to handle this please help ...

我有這樣的代碼:

[self.view addSubview:scrollView];
UIImageView *tempImageView = 
[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Tree.jpg"]];
self.imageView = tempImageView;
[tempImageView release];
[scrollView setContentMode:UIViewContentModeScaleAspectFit];
[imageView sizeToFit];
scrollView.backgroundColor=[UIColor blackColor];
scrollView.contentSize = imageView.frame.size;
scrollView.minimumZoomScale = scrollView.frame.size.width / imageView.frame.size.width;
scrollView.maximumZoomScale = 4.0;
[scrollView setZoomScale:1.0];
scrollView.clipsToBounds = YES;
scrollView.delegate = self;
[scrollView addSubview:imageView];

推薦答案

可能你正在尋找這個,

UIImageView *tempImageView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Watson.jpg"]] autorelease];
tempImageView.frame = scrollView.bounds;
self.imageView = tempImageView;

scrollView.backgroundColor = [UIColor blackColor];
scrollView.minimumZoomScale = 1.0  ;
scrollView.maximumZoomScale = imageView.image.size.width / scrollView.frame.size.width;
scrollView.zoomScale = 1.0;
scrollView.delegate = self;

[scrollView addSubview:imageView];

這篇關于UIImage 在開始時不適合 UIScrollView的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

how to set scrollview content size in swift 3.0(如何在 swift 3.0 中設置滾動視圖內容大小)
Stop a UITableView from automatically scrolling(阻止 UITableView 自動滾動)
iOS UIScrollView Lazy Loading(iOS UIScrollView 延遲加載)
using iOS 6.0 SDK and building for iOS 5 Target causes UIScrollView setMinimumZoomScale to fail when running on iOS 5 simulator(在 iOS 5 模擬器上運行時,使用 iOS 6.0 SDK 并為 iOS 5 Target 構建會導致 UIScrollView setMinimumZ
Create partial-screen UIPageViewController programmatically(以編程方式創建部分屏幕 UIPageViewController)
how to make an ImageView zoomable with or without ScrollView.?(如何使用或不使用 ScrollView 使 ImageView 可縮放?)
主站蜘蛛池模板: 午夜寂寞影院在线观看 | 久久综合色综合 | 色欧美日韩| 好姑娘影视在线观看高清 | 久久一本 | 欧美一级在线观看 | 天天操综合网站 | 欧美男人天堂 | 91欧美激情一区二区三区成人 | 一区二区三区四区电影视频在线观看 | 国产成人高清在线观看 | 久草视频观看 | 日韩在线小视频 | 91免费版在线 | 99热这里都是精品 | 亚洲欧美激情视频 | 欧美视频中文字幕 | 欧美一区二区三区在线免费观看 | 亚洲大片| 久草综合在线 | 成人福利| 国产精品美女久久久 | 亚洲日日夜夜 | 国产精品久久久久久 | 黄色在线免费观看视频 | 国产日产精品一区二区三区四区 | 亚洲精品一区二区在线 | 成人免费在线 | 国产激情视频 | 国产精品一区二区福利视频 | 成人精品一区二区三区 | 国产精品成人一区二区三区 | 国产激情免费视频 | 国产精品区二区三区日本 | 成人免费在线视频 | 日本视频中文字幕 | 久久99精品视频 | 男女精品网站 | 久久久久国产 | 精品欧美黑人一区二区三区 | 久久久久久久久久久久久9999 |