0

我正在为 android 开发一个游戏,它就像一个比赛游戏,它看起来像这样:

http://imageshack.us/photo/my-images/59/96718770.png/

游戏完美运行,但问题是卡片的大小“图片中的小丑”没有改变我已经尝试了从改变图像大小到改变图像视图大小的所有方法,xml文件是Tablelayout 和每行表在第一行中包含一些内容,这是将显示卡片的图像视图,这是 xml 代码

<TableRow
android:id="@+id/Row01"
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:gravity="center"
android:orientation="horizontal"
 >
  <LinearLayout 
    android:id="@+id/LinearLayout01" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_gravity="center" 
    android:gravity="center">
    <ImageView 
        android:id="@+id/ImageView1" 
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_gravity="bottom|center"

    ></ImageView>
    </LinearLayout>
</TableRow>
4

1 回答 1

0

如前所述,在设计布局时应该尽可能避免使用静态值,以便它们保持从微型手机到大型平板电脑的可扩展性。

对于开发 android 的人来说,这是一个常见的问题,在这种情况下,它可能是屏幕密度问题。我建议制作三组不同大小的小丑图标,并将它们放在“res”文件夹中的低、中、高分辨率图像文件夹中。这就是他们拥有这些文件夹的原因,如果您的应用程序可以跨屏幕尺寸进行扩展,那么当您调用该资源时,系统将从文件夹中选择适当的分辨率图像。我相信您还可以修改系统在清单中选择密度的方式。

于 2012-04-11T19:38:48.243 回答