Vuforia View set orientation to Landscape
Hello all,
Is possible to set orientation to landscape mode when ever experience is opened in mobile/tablet ?
/VR
Hello all,
Is possible to set orientation to landscape mode when ever experience is opened in mobile/tablet ?
/VR
Below is the CSS code from the Quadcopter sample experience. You're better off looking at it in the Studio project as pasting it here removes all the indents & formatting.
If you look through you can see that there's the media query to determine orientation and then they define the style for that orientation. So by making the definition different for each orientation, you can make the look of the item change.
There's also more you can read about how this works at W3 schools: https://www.w3schools.com/css/css3_mediaqueries.asp
// Media query to target landscape
@media all and (orientation: landscape) {
// Selects the view and changes the background color
[twx-view="Choice"] {
background: #3d4647;
}
// Uses CSS border property to create a triangular shape
.choiceHeader {
border-top: 20vh solid #fff;
border-right: 20vh solid transparent;
width: 50%;
}
.choiceFooter {
border-bottom: 20vh solid #5f7070;
border-right: 200vh solid transparent;
height: 20vh;
padding: 0;
}
// Uses vh and vw units to adjust for different resolutions
.choicerow {
height: 40vh;
}
.logo {
width: 30%;
}
.horiz, .vert {
padding-top: 52px;
}
}
// Media query to target portrait
@media all and (orientation: portrait) {
[twx-view="Choice"] {
background: #3d4647;
}
.choiceHeader {
border-top: 10vh solid #fff;
border-right: 10vh solid transparent;
width: 80%;
}
.choicerow {
margin-top: 30%;
height: 30vh;
}
.choiceFooter {
border-bottom: 30vh solid #5f7070;
border-right: 60vh solid transparent;
height: 30vh;
padding: 0;
}
.logo {
width: 50%;
}
.horiz, .vert {
line-height: 24px;
max-width: 140px;
min-width: 135px;
padding-bottom: 10px;
padding-top: 62px;
}
}
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.