2
我已创建的联系电话的列表视图,列表项包含QuickContactBadge
和TextView
现在每当我试图图像加载到QuickContactBadge它does not get fit into
的QuickContactBadge框架,并在同一时间QuickBadgeContact itself will also get shrink.
图像不适合QuickContactBadge
现在仪式,我有这个
什么,我想要实现
这样不仅形象,而且即使我试图做一个正常大小
这里的QuickContactBadge是我的代码,我使用
Uri contactUri = Uri.withAppendedPath(
ContactsContract.Contacts.CONTENT_URI,
String.valueOf(contactId));
InputStream input = ContactsContract.Contacts.openContactPhotoInputStream
(
getContentResolver(), contactUri
);
cache.photoView.setImageBitmap(BitmapFactory.decodeStream(input));
我的布局列表项
<QuickContactBadge
android:id="@+id/badge"
android:layout_marginLeft="2dip"
android:layout_marginRight="14dip"
android:layout_marginTop="4dip"
android:layout_marginBottom="3dip"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_height= "wrap_content"
android:layout_width= "wrap_content"
android:src="@drawable/ic_contact_picture"
style="?android:attr/quickContactBadgeStyleWindowSmall" />
<TextView
android:id="@+id/name"
android:textAppearance="?android:attr/textAppearanceMedium"
android:paddingLeft="2dip"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/badge"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
//努力代码的Android:layout_height =“50dp “android:layout_width =”50dp“ – 2012-02-29 12:10:56
@PadmaKumar你的评论作品,你也可以回答它 – Hunt 2012-03-05 09:12:33