创建几十个图标的简单方法?

时间:2014-09-30 22:26:20

标签: android android-layout android-studio imageview android-orientation

在我的应用程序中,我希望有一些显示一系列小图像的活动,我的目标是每行3个,纵向5个,但我对这些数字并不严格。

第一个问题是,我无法弄清楚布局或布局的配置,这将允许我正确地实现这种效果。我已经尝试过TableLayout,FrameLayout和RelativeLayouts,但是没有一个能让我的图像在两个方向上看起来都很好。

在这种情况下,图像是标志。我尝试用中间的符号创建9个补丁,我不想被扭曲。 Android Studio不会认为它们是.9个文件。但这是一个单独的问题。

     <ImageView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:src="@drawable/iceland"
        android:layout_weight="0.25"
        android:scaleType="fitXY"
        android:id="@+id/imageView"/>

我制作了一个我正在努力实现的模型。我真的非常感谢你们提供的任何提示。谢谢!

Flag App 1

Flag App 2

1 个答案:

答案 0 :(得分:0)

<?xml version="1.0" encoding="utf-8"?>
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/gridView1"
    android:numColumns="auto_fit"
    android:gravity="center"
    android:columnWidth="50dp"
    android:stretchMode="columnWidth"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

</GridView>
取自this link

应该提供一个可能对您有用的示例。