你好我有一个布局到comments_logs所有权利,我使用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是我服务器中图片到网址的变量:
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);
请求,如何在圆圈中设置或转换我的图像,我需要弯曲一个角落或半径
问候!
答案 0 :(得分:0)
我通过以下方式解决了这个问题:
AQuery aq = new AQuery(relativeLayout);
ImageOptions options = new ImageOptions();
options.round = 105;
aq.id(R.id.image_comments).image(image_url,options);