剛開始使用xCode 5 storyboard,並且遇到圖像問題。我有一個視圖控制器,它包含一個滾動視圖>圖像視圖。查看xCode storyboard中的圖像寬度擴展
當圖像加載時,它以全尺寸顯示並展開滾動視圖。我試着改變視圖模式並按照如下所示編程調整它的大小,但它不起作用。任何人都可以解釋一下這個問題嗎?
if(!_curInfo.img)
{
showActivity(self);
dispatch_queue_t aQueue1 = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_async(aQueue1, ^{
_curInfo.img = getImageFromURL([NSString stringWithFormat:@"%@%@", g_serverUrl, _curInfo.imgPath]);
dispatch_async(dispatch_get_main_queue(), ^{
hideActivity();
[_imgCompany setImage:_curInfo.img];
});
});
}
_imgCompany.frame = CGRectMake(0,0,320,180);
_imgCompany.contentMode=UIViewContentModeScaleAspectFill;
_imgCompany.clipsToBounds=YES;
[_imgCompany setImage:_curInfo.img];
這裏是什麼樣子
我有一個與iOS公平的exp,但我總是有困難混合滾動和自動佈局。禁用自動佈局並嘗試... – amar
嘗試'_imgCompany.clipsToBounds = NO;' – preetam
是否在故事板中打開了自動佈局的主開關? – bilobatum