簡體   English   中英

UIButton上的標題被截斷

[英]Title on a UIButton truncates

我已經將UIButton設置為導航欄的titleView。 但是,無論按鈕有多寬,標題似乎都被截斷了。 為什么?

UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button setTitle:[[NSDate date] stringWithNSDateFormatterMediumStyle] forState:UIControlStateNormal];
[button setFrame:CGRectMake(0, 0, 150, 40)];
self.navigationItem.titleView = button;

在此處輸入圖片說明

 [button setFrame:CGRectMake(0, 0, 250, 40)];  // are you sure your button is wide enough?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM