开发者

How to strech the image to the width of the layout?

HI,

I want to stretch my image to the layout width, how can i do this using xml layouts ?

<LinearLayout android:layout_width="700dp"
        android:layout_height="310dp" android:orientation="vertical">
        <TextView android:id="@+id/widget37" android:layout_width="fill_parent"
            android:layout_height="wrap_content" android:text="Welcome Ramesh Kumar,"
            android:paddingTop="5dp" android:textSize="10dp" android:textColor="#02284D"
            android:gravity="left">
        </TextView>
        <TextView android:id="@+id/widget37" android:layout_width="fill_parent"
            android:layout_height="w开发者_如何转开发rap_content" android:text="Employee Id: 152490"
            android:textSize="10dp" android:textColor="#02284D" android:gravity="left">
        </TextView>
        <RelativeLayout android:layout_width="fill_parent"
            android:layout_height="150dp" android:layout_x="10dp">
            <ImageView android:id="@+id/bannert30"
                android:layout_width="fill_parent" android:layout_height="fill_parent"
                android:src="@drawable/front_screen" android:scaleType="fitEnd"
                android:layout_alignParentLeft="true">
            </ImageView>
        </RelativeLayout>

This is my code please help ?


You can use android:scaleType="fitXY" for the ImageView and another alternative is to set the image as the background of the layout.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜