【发布时间】:2014-03-17 15:04:19
【问题描述】:
我有这个布局:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/AppTheme.Widgets.Box"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="match_parent"
android:layout_height="2dp"
android:scaleType="centerCrop"
android:background="#eee"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:gravity="center"/>
</LinearLayout>
所以,我正在将远程图像从网络加载到 ImageView 中。我知道图像的尺寸,所以我知道宽度:高度比。现在,当我初始化布局时,我需要以某种方式应用此定量,这样它就不会在应用程序中像疯了一样跳跃。
【问题讨论】:
标签: android android-layout imageview android-imageview