【发布时间】:2016-09-15 19:12:46
【问题描述】:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="@dimen/contactUsPad"
tools:context="com.onqanetapp.mp.onqanet.ContactUs_Fragment">
<!-- TODO: Update blank fragment layout -->
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2" />
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=".2"
android:text="@string/contactUsAddHead"
android:textSize="20sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:text="@string/contactUsAdd"
android:textSize="18sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=".6"
android:orientation="horizontal">
<ImageView
android:id="@+id/ivFb"
android:layout_width="@dimen/socialImageWidth"
android:layout_height="@dimen/socialImageHeight"
android:layout_marginRight="@dimen/socialImageRightMargin"
android:src="@drawable/f" />
<ImageView
android:id="@+id/ivIn"
android:layout_width="@dimen/socialImageWidth"
android:layout_height="@dimen/socialImageHeight"
android:layout_marginRight="@dimen/socialImageRightMargin"
android:src="@drawable/in" />
<ImageView
android:id="@+id/ivTw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/socialImageRightMargin"
android:src="@drawable/tw" />
</LinearLayout>
</LinearLayout>
尺寸
<dimen name="socialImageHeight">50dp</dimen>
<dimen name="socialImageWidth">50dp</dimen>
<dimen name="socialImageRightMargin">10dp</dimen>
图片
this is final layout screenshot and i did't change the last imageview to show you guys the problem
信息
- 所有图片均为 png
- 第一个可绘制的开始是 48x48
问题
- wrap_content 应该为这些图像提供分辨率,即 48x48 ,但事实并非如此。
- 当我给它们 50dp 的宽度和高度时,它们看起来被拉伸了,但是 看起来也越界了。
- 72x72 分辨率也很累,但还是一样
【问题讨论】:
-
将此属性用于
ImageViewandroid:scaleType="fitXY"。 -
你没有按照排版规则,请先修复。
-
@AshishShukla ...你能指定什么...我是Android新手。
-
@Mrin 您没有正确使用 android:layout_weight 属性。