【问题标题】:android application 2.3.4 sony ericsson design?android application 2.3.4 索尼爱立信设计?
【发布时间】:2013-06-16 18:01:57
【问题描述】:

我已经在很多设备上测试了我的 Android 应用程序,并且在 2 个使用 android 2.3.4 的索尼爱立信设备上测试了我的 Android 应用程序,但这些设备上的设计完全搞砸了。每个文本框都是可点击的,并且所有内容都有边框.. 看下面的截图(左边是索尼爱立信的照片,右边是其他手机的截图)

谁知道问题出在哪里?主题错误还是什么??

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

<?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>

【问题讨论】:

  • Google Play 中指向您应用程序的链接对我来说很像广告:因此我将其从您的问题中删除。如果您认为对于回答您的问题的人确实需要该链接,请说明为什么会这样,然后将链接放回您的问题中。谢谢。
  • 嗯,这不是真的那么必要,但我认为如果有人可以测试应用程序,如果他们有 android 会有所帮助?如果下载了该应用程序,我真的什么都没有。这是一个学校项目..
  • 您是否获得报酬并不真正相关。不需要该链接(IMO)。无论如何,SO 并不是真的要让你找人来测试你的应用程序。但是,SO 的人员 可以 帮助您解决任何代码问题。因此,如果您可以发布一个在特定版本的 Android 上看起来很奇怪的 UI 组件的小型工作(代码)示例,请继续编辑您的问题以包含代码。祝你好运!

标签: android testing sony


【解决方案1】:

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

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

values 文件夹中的themes.xml

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

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

</resources>

values-11 文件夹中的themes.xml

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

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

</resources>

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

同样,如果需要,也应该在 values-14 中有一个 theme.xml。

现在在您的 Manifest.xml 中,您可以简单地将自定义主题用作

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

android developer site 上查看如何定义主题和样式

希望对您有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多