找到你要的答案

Q:A simple text is appearing on emulator but not appearing on device

Q:一个简单的文本出现在模拟器上,但没有出现在设备上

I am trying a very simple application that is displaying two text field and a button (background color changed).

This is appearing fine on Emulator but when i am trying the same on actual device, one text field is not displaying and button color changed to standard color.

Any quick help ?

Regards, Gul

XML

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceSmall"
    android:text="@string/enter_phone_number"
    android:id="@+id/EnterNumberMsg"
    android:clickable="false"
    android:visibility="visible"
    android:textStyle="bold"
    android:textSize="15sp"
    android:textIsSelectable="false"
    android:textColor="#c816365c"
    android:textAlignment="center"
    android:password="false"
    android:background="#fa538dd5"
    android:layout_centerHorizontal="true"
    android:layout_below="@+id/LogoMsg"
    android:layout_marginTop="100dp" />

我正在尝试一个非常简单的应用程序,显示两个文本字段和一个按钮(背景颜色改变)。

这在模拟器上看起来很好,但当我在实际设备上尝试相同的时候,一个文本字段不显示,按钮颜色改为标准颜色。

有什么快捷的帮助吗?

Regards, Gul

XML

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceSmall"
    android:text="@string/enter_phone_number"
    android:id="@+id/EnterNumberMsg"
    android:clickable="false"
    android:visibility="visible"
    android:textStyle="bold"
    android:textSize="15sp"
    android:textIsSelectable="false"
    android:textColor="#c816365c"
    android:textAlignment="center"
    android:password="false"
    android:background="#fa538dd5"
    android:layout_centerHorizontal="true"
    android:layout_below="@+id/LogoMsg"
    android:layout_marginTop="100dp" />

answer1: 回答1:

Change your margin from 100 dp to some other low value..because as you said its not visible, size of your cell is smaller than your emulator.

改变你的保证金从100 DP其他一些低值..因为你说的不可见的,你的细胞的大小是小于你的模拟器。

android  android-layout