我想問如何設置imageview的procentual寬度和高度?Android設置procentual大小imageView
我試圖找到任何工作解決方案,但沒有形成他們ws不爲我工作。
感謝您的任何幫助。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:id="@+id/layoutContainer" android:orientation="vertical">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="3">
<!--HERE I NEED TO SET PROCENTUAL HEIGHT -->
<ImageView
android:id="@+id/ivFlag1"
android:layout_alignParentTop="true"
android:layout_width="200dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:src="@drawable/car_finder_logo" />
</RelativeLayout>
</LinearLayout>
爲什麼你裏面有一個線性相對佈局? – pskink
您在'ImageView'中定義了兩次layout_width。這甚至不會編譯。 – joao2fast4u