بروز خطا
[message]
اشتراک در سوال
رای ها
[dataList]
مشکل با adjustViewBounds در API های زیر 18
سلام. پارامتر android:adjustViewBounds="true" برای api های بالای 18 (اندروید 4.4) کاربرد دارد، در صورتیکه می خواهم برای اندروید 4 به بالا برنامه را اجرا کنم.
باید چکار کنم تا سایز عکس خراب نشود؟
کدهای xml من :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:background="@color/white"
tools:context="com.example.uifx.project_21march17.ProfileActivity">
<ImageView
android:id="@+id/form_background_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="@drawable/form_background" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/standard_margin"
android:layout_marginTop="@dimen/standard_margin"
android:text="اطلاعات کاربری"
android:textColor="@android:color/white"
android:textSize="@dimen/large_font_size" />
<ImageButton
android:id="@+id/back_button"
android:layout_width="@dimen/action_button_size"
android:layout_height="@dimen/action_button_size"
android:layout_centerVertical="true"
android:layout_marginStart="@dimen/standard_margin"
android:layout_marginTop="@dimen/standard_margin"
android:background="@null"
android:src="@drawable/ic_action_back_white" />
</RelativeLayout>
<Button
android:id="@+id/edit_avatar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/form_background_image"
android:layout_alignEnd="@id/form_background_image"
android:layout_marginEnd="@dimen/standard_margin"
android:text="تغییر عکس" />
<ImageView
android:layout_width="0dp"
android:layout_height="62dp"
android:layout_above="@id/edit_avatar"
android:layout_alignEnd="@id/edit_avatar"
android:layout_alignStart="@id/edit_avatar"
android:src="@drawable/default_avatar" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/form_background_image"
android:orientation="vertical"
android:padding="@dimen/standard_margin">
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/standard_margin"
android:layout_gravity="right"
android:text="اطلاعات فردی"
android:textSize="@dimen/normal_font_size"
android:textColor="@android:color/black"/>
<EditText
android:id="@+id/edittext_firstName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/standard_margin"
android:layout_marginRight="@dimen/form_field_margin"
android:layout_marginLeft="@dimen/form_field_margin"
android:maxLines="1"
android:maxLength="20"
android:textSize="@dimen/small_font_size"
android:hint="نام"/>
<EditText
android:id="@+id/edittext_lastName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/standard_margin"
android:layout_marginRight="@dimen/form_field_margin"
android:layout_marginLeft="@dimen/form_field_margin"
android:maxLines="1"
android:maxLength="30"
android:textSize="@dimen/small_font_size"
android:hint="نام خانوادگی"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/standard_margin"
android:layout_gravity="right"
android:text="تخصص ها"
android:textSize="@dimen/normal_font_size"
android:textColor="@android:color/black"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="@dimen/standard_margin"
android:gravity="center">
<CheckBox
android:id="@+id/java_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/standard_margin"
android:checked="true"
android:text="جاوا"/>
<CheckBox
android:id="@+id/css_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/standard_margin"
android:text="CSS"/>
<CheckBox
android:id="@+id/html_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/standard_margin"
android:text="HTML"/>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/standard_margin"
android:layout_gravity="right"
android:text="جنسیت"
android:textSize="@dimen/normal_font_size"
android:textColor="@android:color/black"/>
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/standard_margin"
android:orientation="horizontal"
android:gravity="center">
<RadioButton
android:id="@+id/female_radio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/standard_margin"
android:text="زن"/>
<RadioButton
android:id="@+id/male_radio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="مرد"/>
</RadioGroup>
<Button
android:id="@+id/save_form"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/form_field_margin"
android:layout_marginLeft="@dimen/form_field_margin"
android:text="ثبت اطلاعات"
/>
</LinearLayout>
</RelativeLayout>
برای این سوال پاسخی وجود ندارد.
پاسخگویی و مشاهده پاسخ های این سوال تنها برای اعضای ویژه سایت امکان پذیر است .
چنانچه تمایل دارید به همه بخش ها دسترسی داشته باشید میتوانید از این بخش لایسنس این آموزش را خریداری نمایید .