裁剪图像机器人到角落



你好,我有一个布局要评论_logs allign right,我使用的是Aquery Android我的Xml布局

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="left"
    android:background="@android:color/white"
    android:layout_marginTop="15dp"
    android:paddingRight="8dp">

    <ImageView
        android:id="@+id/image_comments"
        android:layout_width="120dp"
        android:layout_height="120dp"
        android:src="@drawable/ic_launcher"
        android:padding="10dp"
        android:layout_alignParentLeft="true"
        android:cropToPadding="true"
        android:scaleType="centerCrop" />

    <TextView
        android:id="@+id/message"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello_world"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:textColor="@android:color/black"
        android:layout_centerVertical="true"
        android:layout_toRightOf="@+id/image_comments"
        android:layout_toEndOf="@+id/image_comments" />

</RelativeLayout> 

在我的类中,image_url是我的变量,用于我的服务器中的图像到url:

String image_url="example_for_image_url_string"
int layout_id = R.layout.layout_comment_left;
RelativeLayout relativeLayout = (RelativeLayout) inflater.inflate(layout_id, null, false);
                                AQuery aq = new AQuery(relativeLayout);
                                aq.id(R.id.image_comments).image(image_url);


 TextView message = (TextView) relativeLayout.findViewById(R.id.message);
                            message.setText(message_json);
                            layout.addView(relativeLayout);

Please,如何在圆圈中设置或转换我的图像,我需要croop一个角或半径

问候!

我通过解决了这个问题

AQuery aq = new AQuery(relativeLayout);
ImageOptions options = new ImageOptions();
options.round = 105;
aq.id(R.id.image_comments).image(image_url,options);

相关内容

最新更新