Ich baue eine Anwendung mit Appcelerator Studio auf Android. Ich habe nur Android Tablet benutzt aber jetzt sollte ich auch ein Smartphone benutzen. Wenn ich versuche, die Anwendung zu öffnen, ist das Layout nicht korrekt, das Layout ist zu groß für den Bildschirm des Smartphones.So erstellen Sie ein Layout für Smartphone und Tablet mit Appcelerator
Jetzt gibt es eine Möglichkeit, das Layout für Tablet und Smartphone anzupassen?
Zum Beispiel, das ist mein Login-Box:
login.xml Accedi
<TextField id="username" class="textLogin" hintText="Insert username"></TextField>
<TextField id="password" class="textLogin" hintText="Insert password"
passwordMask="true"></TextField>
<View id="buttons_container" >
<!--<Button id="changeLanguageButton" class="buttonLanguage"
onClick="languageListener" >Lingua</Button>-->
<Button id="loginButton" class="buttonLogin">Login</Button>
<Button id="emergencyButton" class="buttonEmergency">Emergency</Button>
</View> <!-- end buttons_container -->
</View>
</Alloy>
login.tss
".container" : {
backgroundColor: "#666",
width : 600,
height : 500,
layout : "vertical",
borderRadius : 40,
borderWidth : 2,
// borderColor : "#E6E6E6",
borderColor: "#fff",
}
".images":{
top: 20,
// left: "161px",
backgroundImage : "/images/logo_decipher.png",
width : "402px",
height: "62px",
// height : "80px"
}
".loginLable":{
top : 20,
color : "#B3B3B3",
textAlign : "center",
width: '340px',
font : {
fontSize : "20pt",
fontWeight : "Italic"
}
}
".textLogin":{
top : 20,
height : "60px",
backgroundColor : "#c9c9c9",
borderRadius : 10,
borderWidth : 1,
borderColor : "#fff",
color : "#fff",
width: '340px',
font : {
fontFamily : 'Roboto-Regular',
fontSize : "14pt",
fontWeight : "Regular"
},
paddingLeft : 10
}
"#buttons_container": {
top: 80,
width: 340,
height: 60,
}
".buttonLogin":{
left: 0,
width: 160,
height : 60,
backgroundColor : "#29ABE2",
borderRadius : 10,
borderColor: "#fff"
}
".buttonEmergency":{
right: 0,
width: 160,
height : 60,
backgroundColor : "#29ABE2",
borderRadius : 10,
borderColor: "#fff"
}