---
title: "UIButton 按钮状态和设置"
author: "jguangyou"
date: "2012-11-28T12:00:46Z"
tags: []
categories: ["移动开发"]
slug: "uibutton"
draft: false
lastmod: "2012-11-28T12:00:46Z"
id: 1736518
url: "https://deep-fish.iteye.com/blog/1736518"
---

UIButton的状态有 deault、hightlight、selected和disabled，对应的为：

 

UIControlStateNormal               //正常状态

UIControlstateHighlighted         //高亮

UIControlStateDisabled            //禁用状态

UIControlStateSelected           //选中状态

 

 

设置方法为：

 

.highlighted = YES/NO

.enabled = YES/NO

.selected = YES/NO