Posted by: Anonym
Setsize und Android App - 08.03.2018, 14:57:11
Moin ich bin gerade bei einer App für Android Smartphones und irgendwie Funktioniert das Resizen nicht.
main.js
home_android.html
Habe den Quellcode stark verkürzt
main.js
Code:
/* Spieler betritt den Raum */ App.onUserJoined = function(user){ var nick = user.getNick(); var clientType = user.getClientType(); if(clientType == "Android") { var htmlFile = new HTMLFile('home_android.html', {}); appContentEdit = AppContent.overlayContent(htmlFile, 300, 110); if(user.canSendAppContent(appContentEdit)===true) { user.sendAppContent(appContentEdit); } } else{ var htmlFile = new HTMLFile('home.html', {}); appContentEdit = AppContent.overlayContent(htmlFile, 170, 245); if(user.canSendAppContent(appContentEdit)===true) { user.sendAppContent(appContentEdit); } } };
home_android.html
Code:
<!DOCTYPE html> <html> <head> <title>Übersicht</title> <meta charset="UTF-8" /> <script type="text/javascript" src="UserApps-API.js"></script> <script type="text/javascript" src="/apps/api/jquery.min.js"></script> <script type="text/javascript"> function BMin(){var hostFrame = Client.getHostFrame().setSize(300, 30);} function BMax(){var hostFrame = Client.getHostFrame().setSize(300, 110);} </script> </head> <body> <table> <tr> <td colspan="1"><button name="button" id="BMins" onclick="BMin()">_</button></td> <td colspan="2"><font id="top">Was bist du?</font></td> <td colspan="1"><button name="button" id="BMaxs" onclick="BMax()">[]</button></td> </tr> </table> </body> </html>
Habe den Quellcode stark verkürzt