Choose a style in Android 2.3 different from Android 4.2

I am working on a PhoneGap application in which a button click generates a certain number of text fields and selects fields based on user input.

I tested the application on AVD running Android 4.2. Everything worked fine, and the selected cells created along with the text fields looked like this:

Now I tested the same application in AVD running Android 2.3, which gave me the result shown here:

.

Clearly, only the selection window seems weird in Android 2.3, while other controls, such as the text box and buttons, are absolutely wonderful.

I do not know why this is happening. The application uses JQM and Cordova 2.5.0.

To give you a reason for what I'm trying to explain, I have added the code below, which is my markup for the select block

<select class="sel" data-theme="a" id="selectmenu0"> <option value="1">option1</option> <option value="2">option2</option> <option value="3">option3</option> </select> 
+6
source share
2 answers

I myself solved the problem. The problem was how I created the markup. For some unknown reason, Android 2.3 expects the DOM to be created before moving to the next page where the generated DOM will be inserted.

But in my case, upon receiving input from the user, I performed the following operations

  • I went to the landing page
  • Then I built the select block markup

For some reason, Android 2.3 expects the above steps to be in reverse order. Only then does JQM apply its style to select a field.

+3
source

I had the same problem and solved it by setting the "data-native-menu" parameter to false, for example:

 <select id="yourSelectBox" data-native-menu="false"></select> 

I think it is easier.

+1
source

Source: https://habr.com/ru/post/948200/


All Articles