Set mScrollAfterUpdatePosition to true when you get the keyboard forcus.
- The cursor position is not correctly displayed when The text field is
focus out and then focus in.
[sample]
Stage stage = Dali::Stage::GetCurrent();
stage.SetBackgroundColor(Color::WHITE);
stage.KeyEventSignal().Connect(this, &HelloWorldController::OnKeyEvent);
test1 = TextField::New( );
test1.SetProperty( TextField::Property::TEXT,"Abcdefghijklmnopqrstuvw Abcdefghijklmnopqrstuvw Abcdefghijklmnopqrstuvw" );
test1.SetSize( 400, 50 );
test1.SetPosition(50, 80);
test1.SetParentOrigin(ParentOrigin::TOP_LEFT);
test1.SetAnchorPoint(AnchorPoint::TOP_LEFT);
test1.SetProperty(TextField::Property::ELLIPSIS, true);
test1.SetProperty( TextField::Property::TEXT_COLOR, Color::RED );
stage.Add( test1 );
test1.SetKeyboardFocusable(true);
void OnKeyEvent(const KeyEvent& event)
{
if(event.state == KeyEvent::Down)
{
if(event.keyPressedName == "1") {
KeyboardFocusManager::Get().SetCurrentFocusActor( test1 );
}
}
}
Change-Id: I3e83998523107f8b64cdce891fbcd17850724df8