UILabelのテキストに下線を付けたいと思います。私はObjCの次のコードを見つけました:
NSDictionary *underlineAttribute = @{NSUnderlineStyleAttributeName: @1}
myLabel.attributedText = [[NSAttributedString alloc] initWithString:@"Test string"
attributes:underlineAttribute];
これをC#に移植しようとしていますが、機能していません。私は次のことを試みています:
var keys = new object[] { "NSUnderlineStyleAttributeName" };
var objects = new object[] { 1 };
NSDictionary underlineAttribute = NSDictionary.FromObjectsAndKeys(objects, keys);
label.AttributedText = new NSAttributedString(@"Test",underlineAttribute);
1の代わりに、「1」とNSUnderlineStyle.Singleも試しましたが、何も機能していません
何か案は?
ありがとう