2
背景,我想这个图像上看到创建类似的东西:的iOS NSAttributedString圆润与色彩
我设法创建NSMutableAttributedString evertyhing,除了橙色的圆角矩形。我可以使用BackgroundColor将背景设置为该颜色,但我无法找到使其圆整的方法。任何样本我怎么能做到这一点?我发现这个答案,但我不能让它在MonoTouch的工作:NSAttributedString background color and rounded corners
我在Xamarin.iOS代码:
var stringBuilder = new NSMutableAttributedString();
stringBuilder.Append(new NSAttributedString("26"));
stringBuilder.SetAttributes(new UIStringAttributes(){BackgroundColor = UIColor.Orange}, new NSRange(stringBuilder.Length - appendString.Length, appendString.Length));
label.AttributedText = stringBuilder;
这对我不起作用,因为我只使用一个标签来显示所有的值。 – Roosevelt