android应用2.3.4索尼爱立信设计?

时间:2013-06-16 18:01:58

标签: android testing sony

我已经在很多设备上测试了我的Android应用程序,并在Android 2.3.4上测试了2 sony ericcson,但是设计在这些设备上完全搞砸了..每个文本框都是可点击的,并且周围有一个边框..观看下面的截图(左边你看sony ericcson上的照片和其他手机上的右截图)

有谁知道问题是什么?错误的主题还是什么?

enter image description here enter image description here

enter image description here enter image description here

以下是我用于最后一张图片的代码:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#003e79"
android:orientation="vertical"
android:weightSum="100" >

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="50" >

    <ImageView
        android:id="@+id/ivNavigation"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:layout_margin="15dp"
        android:layout_weight="50"
        android:src="@null" />

    <ProgressBar
        android:id="@+id/pbNavigation"
        style="?android:attr/progressBarStyleLarge"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:visibility="visible" />

</RelativeLayout>

<TextView
    android:id="@+id/tvNavText"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_margin="15dp"
    android:layout_weight="50"
    android:text="Large Text"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:textColor="#ffffff"
    android:textSize="20dp" />

</LinearLayout>

1 个答案:

答案 0 :(得分:1)

确保您已在值,值-11和值-14文件夹中定义了正确的主题。

以下是我的themes.xml文件示例,该文件定义了一个名为MyTheme的主题,用于名为MyActivity的活动。

值文件夹中的

themes.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <style name="MyTheme" parent="@android:style/Theme.Light"></style>

</resources>

themes.xml in values-11文件夹

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <style name="MyTheme" parent="@android:style/Theme.Holo.Light"></style>

</resources>

请注意for values文件夹主题的父级是Theme.Light,它在api级别低于11时可用。对于values-11文件夹,主题的父级是Theme.Holo.Light,它在api级别11中可用。< / p>

同样,如果需要,还应该在values-14中使用themes.xml。

现在,在您的Manifest.xml中,您只需将自定义主题用作

即可
<activity
      android:name=".MyActivity"
      android:label="@string/app_name"
      android:theme="@style/MyTheme" >    
 </activity>

查看如何在android developer site

上定义主题和样式

希望有所帮助。