0
你好我使用這個庫: https://github.com/DenisMondon/material-design-library將IMG URL設置爲CardView?
有誰知道我怎麼能programatilly設置圖像URI,URL到這一點:
<com.blunderer.materialdesignlibrary.views.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:mdl_title="CardView"
app:mdl_description="A Left Image CardView"
app:mdl_normalButton="Normal"
app:mdl_highlightButton="Highlight"
app:mdl_imagePosition="left"
app:mdl_image="@drawable/image" />
它只有一個選項:mCardView.setImageResource();
我需要像Image View一樣使用:mImageView.setImageBitmap(bitmap);
謝謝
這意味着我必須把它添加到CardView庫。我剛剛通過gradle導入了庫。 - 這意味着我必須將它作爲模塊導入才能編輯它? –
Joolah
@Joolah複製源代碼,添加到你的項目中,你也可以使用反射來完成這項工作。 – rainash