相关疑难解决方法(0)

UIImage圆角

我尝试在UIImage上得到圆角,到目前为止我读到的,最简单的方法是使用蒙版图像.为此我使用了TheElements iPhone Example中的代码和我找到的一些图像大小调整代码.我的问题是resizedImage总是为nil而且我没有找到错误...

- (UIImage *)imageByScalingProportionallyToSize:(CGSize)targetSize
{
    CGSize imageSize = [self size];
    float width = imageSize.width;
    float height = imageSize.height;

    // scaleFactor will be the fraction that we'll
    // use to adjust the size. For example, if we shrink
    // an image by half, scaleFactor will be 0.5. the
    // scaledWidth and scaledHeight will be the original,
    // multiplied by the scaleFactor.
    //
    // IMPORTANT: the "targetHeight" is the size of the space
    // we're drawing into. The "scaledHeight" is …
Run Code Online (Sandbox Code Playgroud)

iphone cocoa-touch

63
推荐指数
6
解决办法
7万
查看次数

聚焦时 tvOS 中的 UITextField 边框

我已经为 UITextField 层设置了一个自定义边框。当 UITextField 获得焦点时,视图会变大。但该层没有放大。因此在视图中间绘制了边框我做错了什么?

focus uitextfield tvos

3
推荐指数
1
解决办法
697
查看次数

标签 统计

cocoa-touch ×1

focus ×1

iphone ×1

tvos ×1

uitextfield ×1