我試圖在我當前的應用程序上支持mdpi,hdpi和xhdpi。問題是我從網上抓取圖片(配置文件圖片)。我正在使用height = 200dp
的imageview,事情是,即使我已經閱讀了大量有關dp和dpi的教程和文檔,但我仍然沒有得到它們。從網絡的Android圖像大小
所以我的問題是,在hdpi手機上(ATRIX 2)圖片後在屏幕上,這是非常適合我的約1/3。但在mdpi(銀河王牌),它需要近2/3。
什麼是設置高度爲ImageView的(來自網絡,而不是資源),以支持MDPI和華電國際的最佳途徑。
感謝
<ImageView
android:id="@+id/expositor_image"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_below="@+id/expositor_info_header"
android:layout_centerHorizontal="true"
android:layout_marginTop="-27dp"
android:contentDescription="@string/misc_placeholder"
android:scaleType="centerCrop" />
基本上我的問題是,200dp需要屏幕的不同%的MDPI和HDPI
那裏。我編輯並添加了代碼 – 2013-05-08 19:46:57