ios中图片拉伸用法
来源:互联网 发布:中文域名怎么买 编辑:程序博客网 时间:2024/05/16 18:47
Creates and returns a new image object with the specified cap values.
Deprecation Statement
Deprecated. Use the resizableImageWithCapInsets: instead, specifying cap insets such that the interior is a 1x1 area.
Declaration
SWIFT
func stretchableImageWithLeftCapWidth(_ leftCapWidth: Int,
topCapHeight topCapHeight: Int) -> UIImage
OBJECTIVE-C
- (UIImage *)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWidth
topCapHeight:(NSInteger)topCapHeight
Parameters
leftCapWidth
The value to use for the left cap width. Specify 0 if you want the entire image to be horizontally stretchable. For a discussion of how a non-zero value affects the image, see the leftCapWidth property.
topCapHeight
The value to use for the top cap width. Specify 0 if you want the entire image to be vertically stretchable. For a discussion of how a non-zero value affects the image, see the topCapHeight property.
Return Value
A new image object with the specified cap values.
Discussion
During scaling or resizing of the image, areas covered by a cap are not scaled or resized. Instead, the 1-pixel wide area not covered by the cap in each direction is what is scaled or resized. This technique is often used to create variable-width buttons, which retain the same rounded corners but whose center region grows or shrinks as needed.
You use this method to add cap values to an image or to change the existing cap values of an image. In both cases, you get back a new image and the original image remains untouched.
Import Statement
OBJECTIVE-C
@import UIKit;
SWIFT
import UIKit
Availability
Available in iOS 2.0 and later.
Deprecated in iOS 5.0.
stackoverflow中的注释相关信息http://stackoverflow.com/questions/12623961/stretch-background-image-for-uibutton/12625066#12625066
- ios中图片拉伸用法
- iOS中图片拉伸技巧
- iOS中图片拉伸技巧
- iOS中图片自适应拉伸
- iOS中图片拉伸的方法
- IOS中设置图片拉伸区域
- iOS中图片的拉伸处理技巧
- iOS中图片拉伸的方法
- IOS中图片拉伸代码实现
- iOS中图片拉伸的方法
- ios中拉伸图片的方法
- 在IOS中设置原始图片拉伸
- iOS中图片拉伸的方法
- IOS图片拉伸
- iOS图片拉伸
- iOS图片拉伸技巧
- ios图片拉伸
- iOS 图片拉伸
- Java Socket网络编程的经典例子(转)
- 什么是一个对象?
- collectionview使用
- 关于delegate(代理)总结
- ios启动载入启动图片
- ios中图片拉伸用法
- 代码搭建记事本框架(二)
- 代码搭建记事本框架(一)
- (转)RVA-相对虚拟地址解释
- BigInger isProbablePrime
- 理解奈奎斯特定理和香农定理
- Ubuntu16.04下配置YouCompleteMe
- ubuntu下安装ctags和taglist
- ubuntu下gdb代码调试