मैं स्टाइल किए गए स्ट्रिंगलेमेंट की चौड़ाई को नियंत्रित करने के प्रयास में अपनी कक्षा MyStyledStringElement और subclass StyledStringElement और IElementSizing बना देता हूं। दुर्भाग्य से, नीचे दिया गया कोड केवल getheight() में सेल की ऊंचाई का आकार बदलता है। क्या कोई getWidth() विधि है जिसका उपयोग मैं स्टाइलस्ट्रिंगलेमेंट की चौड़ाई समायोजित करने के समान या कुछ ऐसा कर सकता हूं ताकि यह UIButton जैसा ही दिखता हो? हमेशा अग्रिम धन्यवाद।monotouch.dialog styledstringelement सेल चौड़ाई समायोजित करें
public override UITableViewCell GetCell (UITableView tv)
{
var cell = base.GetCell (tv);
cell.AutosizesSubviews = false;
//tv.TranslatesAutoresizingMaskIntoConstraints = false;
cell.ClipsToBounds = false;
cell.Frame.Width = 30;
cell.Bounds.Width = 30;
cell.Frame.Size = new System.Drawing.SizeF (30, 30);
return cell;
}
#region IElementSizing implementation
public float GetHeight (UITableView tableView, NSIndexPath indexPath)
{
//throw new NotImplementedException();
tableView.Frame.Width = 10;
//tableView.Bounds.Width = 10;
tableView.Frame.Height = 10;
Console.WriteLine (tableView.ToString());
return 10;
}
#endregion