Articles in this section
Category / Section

How to set Common theme for a sample so that the UI looks the same in all the platforms?

1 min read

By default, Mobile JS control’s UI changes with respect to the platform, such as IOS7, Android, and Windows and gets rendered. To render the controls irrespective of its platform, you can set the specific UI theme as an attribute in the head tag as mentioned in the following code example. In the following example, iOS theme gets rendered in all devices.


<!DOCTYPE html>
<head data-ej-ios7="true">
<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no" />
<meta charset="UTF-8">
<link href="themes/" rel="stylesheet" type="text/css" />
<title>Sample Page title>
<script src="scripts/jquery-2.0.0.min.js" type="text/javascript">script>
<script src="scripts/jquery.validate.min.js" type="text/javascript">script>
<script src="scripts/jsrender.min.js" type="text/javascript">script>
<script src="scripts/" type="text/javascript">script>

The attributes for different render mode are listed here. A Theme, or render mode, called “Flat” provides generic appearance in all platforms instead of its native appearance.

1. IOS7 – data-ej-ios7 =”true”

2. Android – data-ej-android = “true”

3. Windows – data-ej-windows = “true”

4. Flat – data-ej-flat = “true” (Generic theme)

You can make the application to be rendered with a common theme in all devices using this method.


Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment