| | |
| | | using Foundation; |
| | | using Shared.IO; |
| | | using System; |
| | | using CoreGraphics; |
| | | |
| | | namespace Shared |
| | | { |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 是否显示粗体 |
| | | /// </summary> |
| | | bool isBold; |
| | | public bool IsBold |
| | | { |
| | | get |
| | | { |
| | | return isBold; |
| | | } |
| | | set |
| | | { |
| | | isBold = value; |
| | | if (isBold) |
| | | { |
| | | iosButton.TitleLabel.Font = UIFont.FromName("Helvetica-Bold", mTextSize); |
| | | } |
| | | else |
| | | { |
| | | iosButton.TitleLabel.Font = UIFont.FromName("Helvetica", mTextSize); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取字体长度 |
| | | /// </summary> |
| | | public int GetTextWidth() |
| | | { |
| | | int textWidth = 0; |
| | | CGSize fontSize = this.Text.StringSize(iosButton.TitleLabel.Font); |
| | | textWidth = (int)fontSize.Width; |
| | | |
| | | return textWidth; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 创新需要创新的信息 |
| | | /// </summary> |
| | | public override void Refresh() |
| | |
| | | IsSelected = isSelected; |
| | | } |
| | | |
| | | float mTextSize = Application.FontSize; |
| | | /// <summary> |
| | | /// 文字大小,默认12 |
| | | /// </summary> |
| | |
| | | } |
| | | set |
| | | { |
| | | mTextSize = value; |
| | | iosButton.TitleLabel.Font = UIFont.FromName(FontName, value); |
| | | } |
| | | } |