- (void)setImage:(nullable UIImage *)image forState:(UIControlState)state; // default is nil. should be same size if different for different states
該方法不會拉伸圖片,保持圖片的原始比例顯示在Button中。如果繼續設置title屬性則無法顯示。
- (void)setBackgroundImage:(nullable UIImage *)image forState:(UIControlState)state UI_APPEARANCE_SELECTOR; // default is nil
該方法會拉伸圖片,平鋪在Button中,不會影響繼續在Button中設置title等屬性。