0
我在tableViewCell中編輯和刪除了tableViewRowAction。目前我使用內置的emojis作爲我的標題,但它太小了。如何使字體變大?UITableViewRowAction在Swift中自定義標題字體大小
我知道我們只能在tableViewRowAction中定製有限數量的東西。但是有沒有辦法繞過它來讓標題字體更大?
我檢查其他線程,其中大部分用於:
UIButton.appearance().setAttributedTitle(NSAttributedString(string: "Your Button", attributes: attributes), forState: .Normal)
與確定過程的字體大小的一組屬性。但是,這會影響所有按鈕,這並不好。
任何幫助非常感謝!謝謝!
嗨感謝您的答覆。 (:但是,UITableViewRowAction不是UIButton類型,所以我不能使用UIButton路徑來設置標題大小。 –
檢查我的更新回答 – Lion
謝謝!我明白,但我該如何設置字符串類型的標題爲NSAttributedString?它給我一個錯誤。這是我的代碼:'let attributes = [NSFontAttributeName:UIFont.systemFontOfSize(20)] as Dictionary! let attributedStringRemove = NSAttributedString(string:「✖︎」,attributes:attributes)'和然後在這裏添加屬性字符串到標題:'let removeAction = UITableViewRowAction(style:.Default,title:attributedStringRemove)' –