3
votes

I have a Problem with the Picker Component in my iOS Build.

iOS Picker normal image iOS Picker error image In the first Image you can see how the Picker normally looks like. In the second Image you can see the Picker has changes his size after it gets focused, but it should stay the same.

Here is my code for the Picker:

Picker pickFamilienstand = findPickFamilienstand(f);
pickFamilienstand.setType(Display.PICKER_TYPE_STRINGS);
pickFamilienstand.setStrings("Familienstand","Ledig","Verheiratet");
pickFamilienstand.setText("Familienstand");
pickFamilienstand.setRenderingPrototype("Familienstand");

In the Codename One Designer I have added to component to a form and set its UIID. I have also customized the design via the Codename One Designer. I set the same Style in three Categories (Unselected, Selected and Pressed). On Android the Picker works fine. I have two iOS devices with exactly the same behavior.

  • iPhone 5s, iOS 8.1
  • iPad

I don’t know which iPad I have, because I don’t have it on me right now. I will add this later.

Any Ideas why the Picker does that?

2

2 Answers

0
votes

This happens when margin isn't identical between the selected/unselected/pressed states triggering a resize on selection but with no revalidate the size doesn't go back.

You need to make sure to define padding/margin to identical values in all the states.

0
votes

I have set the same style in the disabled state and now the picker works properly on iOS.