| | |
| | | } |
| | | } |
| | | |
| | | |
| | | // string PingFangSCRegular = "Helvetica"; |
| | | //string PingFangSCSemibold = "Helvetica-Bold"; |
| | | |
| | | /// <summary> |
| | | /// 普通字体 |
| | | /// </summary> |
| | | public string FontNameNormal = "PingFangSC-Regular"; |
| | | /// <summary> |
| | | /// 粗体 |
| | | /// </summary> |
| | | public string FontNameBold = "PingFangSC-Semibold"; |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="Shared.Button"/> class. |
| | | /// </summary> |
| | | public Button() |
| | | { |
| | | iosButton = new MyButton(this) { }; |
| | | if (Application.IsUsePingFang) |
| | | { |
| | | FontName = FontNameNormal; |
| | | } |
| | | |
| | | iosButton.TitleLabel.Font = UIFont.FromName(FontName, Application.FontSize); |
| | | } |
| | | |
| | |
| | | return iosButton.TitleLabel.Font.Name; |
| | | } |
| | | set{ |
| | | iosButton.TitleLabel.Font = UIFont.FromName(value, iosButton.Font.PointSize); |
| | | try |
| | | { |
| | | iosButton.TitleLabel.Font = UIFont.FromName(value, iosButton.Font.PointSize); |
| | | } |
| | | catch { } |
| | | } |
| | | } |
| | | |
| | |
| | | isBold = value; |
| | | if (isBold) |
| | | { |
| | | iosButton.TitleLabel.Font = UIFont.FromName("Helvetica-Bold", mTextSize); |
| | | iosButton.TitleLabel.Font = UIFont.FromName(FontNameBold, mTextSize); |
| | | } |
| | | else |
| | | { |
| | | iosButton.TitleLabel.Font = UIFont.FromName("Helvetica", mTextSize); |
| | | iosButton.TitleLabel.Font = UIFont.FromName(FontNameNormal, mTextSize); |
| | | } |
| | | } |
| | | } |
| | |
| | | set; |
| | | } |
| | | |
| | | class MyButton : UIKit.UIButton |
| | | public class MyButton : UIKit.UIButton |
| | | { |
| | | [Weak] View view; |
| | | public MyButton(View view) |