随着图像的图像尺寸以xml增加,图像尺寸不会增加

时间:2016-10-26 05:18:32

标签: android xml image

arrow functions

在阅读问题之前,请查看图像。在这里,我想增加最左边的圆的大小,但不管图像大小如何,它都固定在这个大小。谁能帮忙。

以下是代码: -

<LinearLayout
    android:id="@+id/prescription_folder"
    android:layout_weight="1"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="0dp">

    <!-- first segment-->
    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">

        <ImageView
            android:id="@+id/folder_image_first"
            android:src="@drawable/ic_action_circle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

        <ImageView
            android:layout_centerInParent="true"
            android:id="@+id/folder"
            android:src="@drawable/ic_action_folder"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />



        <!-- <ImageView
             android:id="@+id/folder_image_first"
             android:src="@drawable/images_with_folder"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content" />-->

        <TextView
            android:textColor="@color/green"
            android:textStyle="bold"
            android:id="@+id/no_of_files_first"
            android:text="10"
            android:layout_centerInParent="true"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
    </RelativeLayout>


    <!--Middle Text i.e folder name and date-->
    <LinearLayout
        android:layout_marginLeft="18dp"
        android:layout_weight="1"
        android:orientation="vertical"
        android:layout_width="0dp"
        android:layout_height="match_parent">

        <!--android:text="Rx/Prescription"-->

        <TextView
            android:textColor="@color/white"
            android:textStyle="bold"
            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
            android:layout_marginBottom="5dp"
            android:text="ABC"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            />

        <TextView
            android:textColor="#03C9A9"
            android:id="@+id/last_updated_date_first"
            android:text="date"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

    </LinearLayout>

    <!--Last Segement-->
    <LinearLayout
        android:gravity="top|right"
        android:orientation="horizontal"
        android:layout_weight="0.3"
        android:layout_width="wrap_content"
        android:layout_height="match_parent">

        <ImageButton
            android:id="@+id/alert_button_pres"
            android:background="@null"
            android:src="@drawable/ic_action_info"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

    </LinearLayout>


</LinearLayout>

1 个答案:

答案 0 :(得分:0)

它是因为圆圈的自然尺寸比内部的图像最小,Android不适用于百分比,

  1. 解决方案是设置圆的大小和图像的大小。

  2. 其他解决方案是使用坐标绘制圆圈,并在其中放置线性布局,并使用填充内容放置图像的大小

相关问题