Hai Friends, 我开发了一个组合列表视图并在我的htc设备中发布.apk文件的应用程序,设计和对齐一切正常,但问题当我在各种设备如莫罗托罗Droid ,Nexus设备的列表视图的定位出了问题,所以我打算使用的布局文件夹布局,华电国际,布局LDPI和布局MDPI,为我改变了我的清单文件作为支持Android中的多屏幕问题?
<supports-screens android:largeScreens="true"
android:normalScreens="true" android:smallScreens="true"
android:anyDensity="true" />
是不是把android:anyDensity =“true”,我也用dp代替dip。我通过这个网址去了,但仍是无法在这个问题 http://developer.android.com/guide/practices/screens_support.html得到一个清晰的概念。所以朋友们请告诉我(帮助我)在这方面得到清晰的想法,并告诉我有什么错误。这是我的主页xml代码frnds。
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost" android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background_retinav2">
<LinearLayout android:layout_gravity="center" android:foregroundGravity="bottom" android:background="@color/white" android:id="@+id/rl_1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal">
<ImageView android:paddingTop="3dp" android:id="@+id/starthideimage" android:layout_width="30dp" android:layout_height="35dp" android:src="@drawable/newback" />
<HorizontalScrollView android:paddingTop="8dp" android:id="@+id/gv"
android:layout_width="wrap_content" android:layout_marginTop="0dp"
android:layout_height="wrap_content" android:background="#ffffff"
android:scrollbars="none" android:layout_weight="1" android:foregroundGravity="bottom">
<LinearLayout android:id="@+id/san_tag" android:layout_width="wrap_content" android:layout_height="wrap_content">
</LinearLayout>
</HorizontalScrollView>
<ImageView android:paddingTop="3dp" android:id="@+id/Endhideimage" android:layout_width="30dp" android:layout_height="35dp" android:src="@drawable/newforward" />
</LinearLayout>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:id="@android:id/tabcontent"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<ListView android:id="@+id/content_movies" android:cacheColorHint="@color/cachecolor"
android:layout_weight="1" android:scrollbars="vertical"
android:layout_width="fill_parent" android:layout_height="420dp"/>
</FrameLayout>
</LinearLayout>
<TabWidget
android:id="@android:id/tabs"
android:gravity="bottom"
android:layout_gravity="bottom"
android:listSelector="@color/gray"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</TabHost>
问题可能出现在您的布局中。所以我建议你在这里发布它,如果你想获得帮助。 android:anyDensity =“true”意味着你支持所有的屏幕分辨率和android 1.6+。有没有为Android的点:normalScreens = “真正的” 机器人:smallScreens = “真”,如果你有安卓anyDensity = “真”。 – cement 2010-10-18 10:03:53
@ Mr.Cement:u能请通过又来了,我已经发布了乌尔refernce朋友我的主要页面的XML内容。我有一个dobut,如果我使用布局高度fill_parent或wrap_content listview内容隐藏在Morotolo Android设备和Nexus设备,这是我手动更改高度,并将该值在layout-hdpi和layout-ldpi和layout-mdpi。这样对吗???请告诉我 – 2010-10-18 10:10:59
战斗机:你还没有说过你的问题是什么。如果您所说的是“Listviews的对齐错误”,我们无法帮到您。 “出错”一词不是很具体。考虑使用来自DDMS的截图来记录您的问题。此外,如果您的“对齐”属于行的内容,则需要向我们提供行布局XML,而不是活动布局XML。而且,您可能会首先考虑使用'hierarchyviewer'来尝试确定您的布局规则是否按预期行事。 – CommonsWare 2010-10-18 11:34:05