zoukankan      html  css  js  c++  java
  • UIButton左边图片右边文字的做法

     UIImage *yuyinImage = [UIImage imageNamed:@"yuyin.png"];
        [soundButton setImage:yuyinImage forState:UIControlStateNormal];
        [soundButton setImage:yuyinImage forState:UIControlStateSelected];
        [soundButton setImage:yuyinImage forState:UIControlStateHighlighted];
        //top left bottom right
        [soundButton setImageEdgeInsets:UIEdgeInsetsMake(5, 5, 5, 15)];
    
    NSString *soundButtonTitle = @"语音";
        [soundButton setTitle:soundButtonTitle forState:UIControlStateNormal];
        [soundButton setTitle:soundButtonTitle forState:UIControlStateSelected];
        [soundButton setTitle:soundButtonTitle forState:UIControlStateHighlighted];
        [soundButton setTitleEdgeInsets:UIEdgeInsetsMake(5, 10, 5, 0)];
    
    [myButton setTitleEdgeInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; 4个参数是上边界,左边界,下边界,右边界。
  • 相关阅读:
    研究下线程投递
    IOCP笔记
    线程同步之mutex和Semaphore
    线程同步之mutex和event区别
    MyStack
    unix环境高级编程 读书笔记
    binary search tree study
    技术博客地址搜集
    select收数据
    奇怪的问题
  • 原文地址:https://www.cnblogs.com/mgbert/p/3872866.html
Copyright © 2011-2022 走看看