In this version I have many problems with textInputs
Thanks for reporting.
The TextInput issues are known and currently being worked on.
We will publish an example how how to customize the TextInput asap.
As far as changing the color/design of the existing TextInput, I think a better approach for now is to construct your own style for one instead of trying to tweak the existing one, as it’s a bit difficult for now.
Here’s how you would build your own TextInput style from the ground up, fully customizable from there:
<App Theme="Basic">
<StackPanel>
<Style>
<TextInput
ux:InheritStyle="false"
TextAlignment="Left"
HitTestMode="LocalBoundsAndChildren"
Focus.IsFocusable="true"
Focus.Delegate="_textInputCore">
<PlainTextEdit ux:Name="_textInputCore" />
<WhilePressed>
<GiveFocus Target="_textInputCore" />
</WhilePressed>
</TextInput>
</Style>
<TextInput Value="Your text here :)" />
</StackPanel>
</App>
The usual properties like TextColor
, CaretColor
, Margin
etc applied to the TextInput
tag in the Style
will work as expected
Filip
November 18, 2015, 1:28pm
4
Follow-up: Is there a way to limit number of characters in a <TextInput>
? Or show a “…” hiding the rest of the value/string.
If you have the Value as an Observable you can make this hack in JS:
value.addSubscriber(function (v){
if (v.value.length > 100) {
v.value = v.value.substring(0,100);
}
});
The TextInput
on iOS and Android should add the ...
automatically.