固定维度为Android应用程序 [英] Fixed dimension for android app

查看:154
本文介绍了固定维度为Android应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图创建一个Android应用程序将支持3dsbs(并排)模式。正常1080ps电视有1920×1080像素的分辨率。如果我们打开3D模式分辨率会改变,我认为宽度每边增加100像素,这将使每一边都有一个轻微的边框。为了避免这个问题,我试图渲染更多的像素比实际的分辨率。我创建了一个Web应用程序与两面和应用程序在中央部分并渲染两个相同的视图。我在webview中调用url。这是布局,

I am trying to create an android application will support 3d sbs(side by side) mode.A normal 1080ps TV have a resolution of 1920 X 1080 px.If we turn on the 3D mode the resolution will change,I think the width increased by 100 px each side and this will make a slight border on each side.To avoid this problem i was trying to render more pixel than the actual resolution.I was created a web application with two side and the app devided at the central portion and render two identical views.and i called the url in a webview.Here is the layout,

 <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="2120px"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:layout_gravity="center_horizontal"
    >
    <WebView android:id="@+id/webView1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
     />
</LinearLayout>

代码

setContentView(R.layout.content_main);
webView = (WebView) findViewById(R.id.webView1);
webView.setWebViewClient(new WebViewClient());
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("http://192.168.2.200/app/out/");

这里的设计视图看起来像我的要求,但是当我运行我的应用程序,它只输出1920 X 1080分辨率输出。

Here the design view shows like my requirement but when i run my app ,it only output 1920 X 1080 resolution output.

在使用Android之前,尝试使用cordova是可能的,但我找不到任何解决方案。

Before using android a was try is it possible with cordova,but i can't find any solution.

有关详情: cordova应用的固定尺寸

推荐答案

使用此

android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:layout_gravity="center_horizontal">

<WebView android:id="@+id/webView1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>

这篇关于固定维度为Android应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆