Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Padding for text in a Custom Entry element of the monotouch.dialog

$
0
0

I'm using monotouch.dialog in my monotouch ios application. I have a custom Entry Element with this code:

protected override MonoTouch.UIKit.UITextField CreateTextField (System.Drawing.RectangleF frame) { try { System .Drawing .RectangleF _newFrame= new System.Drawing.RectangleF (frame .X + 10, frame.Y ,frame .Width -15,frame .Height ); var field= base.CreateTextField (_newFrame ); field .TextAlignment = UITextAlignment.Right ;

        return field ;
    } catch (Exception ex) {
        MyLog .HandleException (ex);
        return null ;
    }
}

I changed the frame of the CreateTextField method so that I can set a padding for my text. But it just works on the first load. When you scroll to page and back to the entry the paddings has not been added. Also entry has not the padding when you rerun the page. How can I repair my code?


Viewing all articles
Browse latest Browse all 204402

Trending Articles