Sep 24, 2015

Replace default look of SELECT box or dropdownlist on mobile webview

I am using onsen-ui HTML5 UI framework to create my webview mobile app.
With the help of:
  <ons-list-item modifier="tappable">
  </ons-list-item>
On onsen-ui, it does not help inherit existing design into the select box.
An example below.

Default design of the select box on iOS
In this case,
we'll have to write a custom CSS class for the select box to replace the default design.


  .custom-select-box {
    color: inherit;
    font: inherit;
    line-height: initial;
    direction: rtl;
    overflow: hidden;
    height: 40px;
    width: 100%;
    padding: 5px 8px;
    border: none;
    box-shadow: none;
    background-color: transparent;
    background-image: none;
    -webkit-appearance: none;
       -moz-appearance: none;
            appearance: none;
    option {
      direction: initial;
    }
  }

the main part which replace the default view is:
directional: inherit;
appearance: none;
border: none;

Final result

No comments:

Post a Comment

Hey, thank you for spending time leaving some thoughts, that would be really helpful as encouragement for us to write more quality articles! Thank you!