【问题标题】:Android Imagebutton small imagesAndroid Imagebutton小图片
【发布时间】:2014-06-20 19:30:31
【问题描述】:

我制作了 3 张不同的图片,每张图片的尺寸分别为 48x48、72x72、96x96 和 144x144。我将它们导入 eclipse 并将它们放在它们应该进入的文件夹中(drawable-mdpi 等)

这些图像都在ImageButton 上,并且它们都在LinearLayout 中,SeekBar 下。

但是当我启动应用程序时,图像太小了!

<LinearLayout
    android:id="@+id/buttonLayout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentRight="true"
    android:orientation="horizontal" >

    <ImageButton
        android:id="@+id/imageButton2"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_marginBottom="5dp"
        android:layout_weight="0.50"
        android:background="@android:color/transparent"
        android:padding="3dp"
        android:scaleType="centerInside"
        android:src="@drawable/btn_previous" />

    <ImageButton
        android:id="@+id/imageButton1"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_marginBottom="5dp"
        android:layout_weight="0.5"
        android:adjustViewBounds="true"
        android:background="@android:color/transparent"
        android:minHeight="80dp"
        android:minWidth="80dp"
        android:padding="3dp"
        android:scaleType="centerInside"
        android:src="@drawable/btn_play" />

    <ImageButton
        android:id="@+id/imageButton3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="5dp"
        android:layout_weight="0.5"
        android:adjustViewBounds="true"
        android:background="@android:color/transparent"
        android:padding="3dp"
        android:scaleType="centerInside"
        android:src="@drawable/btn_next" />

</LinearLayout>

<SeekBar
    android:id="@+id/seekBar1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_above="@+id/buttonLayout"
    android:layout_margin="5dp" />

我希望它们的大小是当前大小的两倍。我该怎么做才能让它们变大?

【问题讨论】:

    标签: android


    【解决方案1】:

    首先,当您在 GraphicLayout Background set drawable 中单击 imageButton(并从文件夹中选择您的图像)时,我认为您将 Src 设置为不是背景,然后您可以执行诸如 Scale 类型并选择 fitXY 或更改您的 imagebutton 宽度和高度之类的操作,就这些。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-03
      • 2020-01-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-16
      相关资源
      最近更新 更多