android开发分享分享Android平板电脑上开发应用程序不能全屏显示的问题解决

本来lcd应该是800*600的,但总是得到600*600的结果。经过好几天的努力,才解决:复制代码 代码如下:<http://schemas.android.com

本来lcd应该是800*600的,但总是得到600*600的结果。
经过好几天的努力,才解决:

复制代码 代码如下:
<https://schemas.android.com/apk/res/android>”
      package=”myb.x2.app2″
      android:versioncode=”1″
      android:versionname=”1.0″>

                          <android:screenorientation=”portrait”
                  android:label=”@string/app_name”>

     <android:normalscreens=”true”
          android:smallscreens=”true”
          android:anydensity=”true” />

后面加的就可以解决这个问题了,不难理解,但找到这个问题的解决办法却花了我好长时间。
activity中的代码:

复制代码 代码如下:
public class myactivity extends activity {
    public myview v;
    /** called when the activity is first created. */
    @override
    public void oncreate(bundle savedinstancestate) {
        super.oncreate(savedinstancestate);
        // setcontentview(r.layout.main );
        requestwindowfeature(window.feature_no_title);
        getwindow().setflags(windowmanager.layoutparams.flag_fullscreen,
                windowmanager.layoutparams.flag_fullscreen);
        // 获得屏幕宽和高
        windowmanager windowmanager = getwindowmanager();
        display display = windowmanager.getdefaultdisplay();
        int w = display.getwidth();
        int h = display.getheight();
        v=new myview(this,w,h);
        setcontentview(v);
        v.start();
    }

}

上述就是android开发分享分享Android平板电脑上开发应用程序不能全屏显示的问题解决的全部内容,如果对大家有所用处且需要了解更多关于Android学习教程,希望大家多多关注—计算机技术网(www.ctvol.com)!

本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/addevelopment/939260.html

(0)
上一篇 2021年11月13日
下一篇 2021年11月13日

精彩推荐