我正在完成應用程序的開發並將其發送到具有不同設備的beta測試人員。迄今爲止這麼好,除了一臺使用Android 4.4.2的索尼Experia Z1的測試儀外,其他所有功能都完美無缺。他報告說,他無法在屏幕上看到兩個圖像按鈕(請參閱上面的值行和底部的撥號程序之間截圖上缺少的按鈕)。所有其他測試者,不管他們的設備和分辨率如何,都不會報告此類問題。這只是一個用戶。任何幫助爲什麼會發生?我不得不削減下面的XML代碼,因爲字符限制的,兩個下撥號行是不是在那裏...Android:UI項目在某些具有相同分辨率的設備上不可見
編輯:缺少行是在下面的代碼
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/Calculator"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".Calculator">
<LinearLayout
android:id="@+id/valueRows"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:weightSum="100">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center">
<LinearLayout
android:id="@+id/TopRow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="50"
android:baselineAligned="false">
<RelativeLayout
android:id="@+id/heatSector"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_marginRight="1dp"
android:layout_weight="25"
android:background="@android:color/holo_green_dark">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="35dp">
<TextView
android:id="@+id/heatValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="0.25"
android:textColor="@android:color/white"
android:textSize="20sp"
android:textStyle="bold"
android:typeface="normal" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/heatValue"
android:layout_centerInParent="true"
android:layout_marginTop="-6dp"
android:text="W/mm2"
android:textColor="@android:color/white"
android:textSize="10sp" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/ohmSector"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_marginLeft="1dp"
android:layout_weight="25"
android:background="@android:color/holo_red_dark">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginRight="35dp">
<TextView
android:id="@+id/itemOhmValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="0.57"
android:textColor="@android:color/white"
android:textSize="20sp"
android:textStyle="bold"
android:typeface="normal" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/itemOhmValue"
android:layout_centerInParent="true"
android:layout_marginTop="-6dp"
android:text="Ohm"
android:textColor="@android:color/white"
android:textSize="10sp" />
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/BottomRow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/TopRow"
android:layout_marginTop="2dp"
android:weightSum="50"
android:baselineAligned="false">
<RelativeLayout
android:id="@+id/ampSector"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_marginRight="1dp"
android:layout_weight="25"
android:background="@android:color/holo_blue_dark">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="35dp">
<TextView
android:id="@+id/ampValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="15.75"
android:textColor="@android:color/white"
android:textSize="20sp"
android:textStyle="bold"
android:typeface="normal" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/ampValue"
android:layout_centerInParent="true"
android:layout_marginTop="-6dp"
android:text="Amps"
android:textColor="@android:color/white"
android:textSize="10sp" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/wattSector"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_marginLeft="1dp"
android:layout_weight="25"
android:background="@android:color/holo_orange_dark">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginRight="35dp">
<TextView
android:id="@+id/itemWattsValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="150"
android:textColor="@android:color/white"
android:textSize="20sp"
android:textStyle="bold"
android:typeface="normal" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/itemWattsValue"
android:layout_centerInParent="true"
android:layout_marginTop="-6dp"
android:text="Watts"
android:textColor="@android:color/white"
android:textSize="10sp" />
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
<ImageButton
android:id="@+id/helpButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@android:color/transparent"
android:src="@drawable/help"
android:onClick="showHelp" />
<ImageView
android:id="@+id/heatSymbol"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="9dp"
android:layout_marginTop="2dp"
android:src="@drawable/flame" />
<ImageView
android:id="@+id/ohmSymbol"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="5dp"
android:src="@drawable/ohm" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/heatSymbol"
android:layout_marginLeft="2dp"
android:layout_marginTop="14dp"
android:src="@drawable/amp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@id/ohmSymbol"
android:layout_marginTop="13dp"
android:src="@drawable/wattsymbol" />
</RelativeLayout>
</LinearLayout>
中段的XML的
<LinearLayout
android:id="@+id/wickRow"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/valueRows"
android:layout_marginTop="10dp"
android:gravity="center_vertical"
android:baselineAligned="false"
>
<RelativeLayout
android:id="@+id/cottonElement"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center">
<ImageButton
android:id="@+id/cottonButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginRight="-40dp"
android:background="@android:color/transparent"
android:onClick="changeCotton"
android:src="@drawable/cotton" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/meshElement"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center">
<ImageButton
android:id="@+id/meshButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginLeft="-40dp"
android:background="@android:color/transparent"
android:onClick="changeMesh"
android:src="@drawable/mesh" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/parameterRowTop"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/wickRow"
android:layout_marginTop="5dp"
android:gravity="center_vertical"
android:baselineAligned="false">
<RelativeLayout
android:id="@+id/coilDiameterElement"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center">
<ImageView
android:id="@+id/coilDiameterImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/coildiameter" />
<TextView
android:id="@+id/itemCoilDiameterValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/coilDiameterImage"
android:layout_centerInParent="true"
android:layout_marginBottom="20dp"
android:clickable="false"
android:text="2.4"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#ffffffff"
android:textStyle="bold" />
<TextView
android:id="@+id/coilDiameterUnit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp"
android:clickable="false"
android:text="mm"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#ffffffff"
android:textSize="10sp" />
<ImageButton
android:id="@+id/coilDiameterPlus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/coilDiameterImage"
android:layout_alignRight="@+id/coilDiameterImage"
android:layout_marginRight="-1dp"
android:background="@android:color/transparent"
android:onClick="coilDiameterPlusButton"
android:src="@drawable/plusbutton" />
<ImageButton
android:id="@+id/coilDiameterMinus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/coilDiameterImage"
android:layout_alignLeft="@+id/coilDiameterImage"
android:layout_marginLeft="-1dp"
android:background="@android:color/transparent"
android:onClick="coilDiameterMinusButton"
android:src="@drawable/minusbutton" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/wireDiameterElement"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_weight="1"
android:gravity="center">
<ImageView
android:id="@+id/wireDiameterImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/wirediameter" />
<TextView
android:id="@+id/itemWireDiameterValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:clickable="false"
android:text="0.32"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#ffffffff"
android:textStyle="bold" />
<TextView
android:id="@+id/wireDiameterUnit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp"
android:clickable="false"
android:text="mm"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#ffffffff"
android:textSize="10sp" />
<ImageButton
android:id="@+id/wireDiameterPlus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/wireDiameterImage"
android:layout_alignRight="@+id/wireDiameterImage"
android:layout_marginRight="-1dp"
android:background="@android:color/transparent"
android:onClick="wireDiameterPlusButton"
android:src="@drawable/plusbutton" />
<ImageButton
android:id="@+id/wireDiameterMinus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/wireDiameterImage"
android:layout_alignLeft="@+id/wireDiameterImage"
android:layout_marginLeft="-1dp"
android:background="@android:color/transparent"
android:onClick="wireDiameterMinusButton"
android:src="@drawable/minusbutton" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/wrapsElement"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_weight="1"
android:gravity="center">
<ImageView
android:id="@+id/wrapsImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/wraps" />
<TextView
android:id="@+id/wrapsValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:clickable="false"
android:text="6.0"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#ffffffff"
android:textStyle="bold" />
<ImageButton
android:id="@+id/wrapsPlus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/wrapsImage"
android:layout_alignRight="@+id/wrapsImage"
android:layout_marginRight="-1dp"
android:background="@android:color/transparent"
android:onClick="wrapsPlusButton"
android:src="@drawable/plusbutton" />
<ImageButton
android:id="@+id/wrapsMinus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/wrapsImage"
android:layout_alignLeft="@+id/wrapsImage"
android:layout_marginLeft="-1dp"
android:background="@android:color/transparent"
android:onClick="wrapsMinusButton"
android:src="@drawable/minusbutton" />
</RelativeLayout>
</LinearLayout>
.
.
.
.
感謝您的建議,我不知道這應該如何雖然解決我的問題,或者還好說,你說我應該把我的XML的精確副本到一個特殊的文件夾?如果是,那麼應該改變什麼? – CRE8IT 2014-09-23 14:46:27