Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

How to initialize Entry.Text after it is rendered and shown on screen.

$
0
0

I'd like to initialize an Entry with a text value but only after it is fully rendered. The reason is, if the Text property is initialized before rendering, the Entry grows (its Width increases) for long strings, which don't fit inside the Entry. The Entry itself is inside a Grid and I'd like it to keep it fixed size, therefore my attempts to initialize it after allocating size. I tried to set Text in OnSizeAllocated method of the View which contains control, but I encountered a non-deterministic exception. It looks like it is not the right context to assign value to Text property. Does anybody know a better way? Or another way of preventing Entry control from resizing itself when its Text is set before rendering?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>