在ICarousel中调整滑块图像的大小

时间:2016-07-28 08:21:11

标签: ios objective-c icarousel

我正在使用icarousel图片滑块。我的图像宽度超过1300像素,那么如何将它放入单个屏幕,目前它在下一个图像索引上重叠。

1 个答案:

答案 0 :(得分:0)

使用$query = "SELECT positionid FROM vacant WHERE positionid = '".$position."' and ptitle = '".$ptitle."' and location = '".$location."' and vacantd = '".$vdate."' and candidate = '".$resultcandidate."' and cv = '".$cvtorsaf."'"; $sql = mysql_query($query); if (!$sql) { // add this check. die('Invalid query: ' . mysql_error()); } $recResult = mysql_fetch_array($sql); $existName = $recResult["positionid"]; if($existName=="") { $insertTable= mysql_query("insert into vacant (positionid, ptitle, location, vacantd, candidate, cv) values('".$position."', '".$ptitle."', '".$location."', '".$vdate."', '".$resultcandidate."', '".$cvtorsaf."');"); $msg = 'Record has been added. <div style="Padding:20px 0 0 0;"><a href="">Go Back to tutorial</a></div>'; } else { mysql_query("UPDATE vacant SET ptitle = '".$ptitle."', location = '".$location."', vacantd = '".$vdate."', candidate = '".$resultcandidate."', cv = '".$cvtorsaf."' WHERE positionid IN '".$position."'"); $msg = 'Record already exist. <div style="Padding:20px 0 0 0;"><a href="">Go Back to tutorial</a></div>'; } 委托可能有帮助,

使用:

carouselItemWidth

像,

- (CGFloat)carouselItemWidth:(iCarousel *)carousel;

您还可以使用以下属性来获取轮播中当前居中的项目视图。此视图的索引与currentItemIndex匹配。

- (CGFloat)carouselItemWidth:(iCarousel *)carousel{

    UIInterfaceOrientation interfaceOrientation = [[UIApplication sharedApplication] statusBarOrientation];
    if (UIInterfaceOrientationIsPortrait(interfaceOrientation))
    {
        //Handle and return as per your image
        return 200; //return value that is equal or higher than your CarouselItemView width
    }
    else
    {
        //Handle and return as per your image
        return 300; //return value that is equal or higher than your CarouselItemView width
    }
}