我的硬件不同:布局看设备上
谷歌眼镜(屏幕像素密度= 1.5,640 * 360像素分辨率)
VUZIX M100(屏幕像素密度= 0.75,432 * 244px分辨率)
这里是我的布局看起来像在谷歌玻璃:
和VUZIX:
布局源:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll_root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/activity_margin"
android:baselineAligned="false"
android:orientation="horizontal" >
<FrameLayout
android:id="@+id/content_secondary"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2"
android:paddingRight="@dimen/layout_padding">
</FrameLayout>
<View
android:layout_width="@dimen/separator_width"
android:layout_height="match_parent"
android:layout_marginBottom="@dimen/separator_margin_bottom"
android:layout_marginTop="@dimen/separator_margin_top"
android:background="@android:color/darker_gray" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:id="@+id/tv_instructions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="@string/instruction_sign_in"
android:textSize="@dimen/instructions_text_size" />
<FrameLayout
android:id="@+id/content_primary"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/container_primary_padding_left" >
</FrameLayout>
</LinearLayout>
<dimen name="activity_margin">1dp</dimen>
<dimen name="separator_width">1dp</dimen>
<dimen name="separator_margin_top">30dp</dimen>
<dimen name="separator_margin_bottom">30dp</dimen>
<dimen name="instructions_text_size">20sp</dimen>
<dimen name="layout_padding">3dp</dimen>
<dimen name="medium_text_size">30sp</dimen>
<dimen name="small_text_size">22sp</dimen>
<dimen name="almost_large_text_size">50sp</dimen>
<dimen name="large_text_size">60sp</dimen>
<dimen name="huge_text_size">100sp</dimen>
<dimen name="container_primary_padding_left">10dp</dimen>
来源为右布局部分:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp">
<TextView
android:layout_below="@id/tv_row_label"
android:id="@+id/tv_destination"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="AA"
android:textSize="@dimen/huge_text_size" />
</RelativeLayout>
正如你所看到的所有值都是密度无关。但布局仍然看起来不同。可能是什么问题呢?
您的设备是否有不同的物理尺寸? –
@FD_他们有一个投影仪屏幕,所以我不能说真的。 –
嘿@IgorFilippov:你是如何为Google Glass和Vuzix m100开发的?你有使用不同的SDK? – Shruti