آموزش های این وب سایت به صورت رایگان در دسترس است. اطلاعات بیشتر
بروز خطا
   [message]
اشتراک در سوال
رای ها
[dataList]

انیمیشن

amir Alu  12 سال پیش  11 سال پیش
+4 0

سلام

ببخشید من یک سوال دارم.من 2تا لایه ی LinearLayout دارم که داخل هر کدوم 2 تا ImageView هست و واسه ی یکی از این Imageview ها انیمیشنی ساختم به صورت زیر

 <set xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="100"
    android:shareInterpolator="true"
    >
    <scale 
    android:interpolator="@android:anim/bounce_interpolator"
    android:fromXScale="0.8"
    android:toXScale="2.2"
    android:fromYScale="0.8"
    android:toYScale="2.2"
    android:duration="100"
    android:fillAfter="false"
    android:repeatCount="3"
    android:repeatMode="reverse"
    android:pivotX="50%p"
    android:pivotY="25%p"/>
    <alpha 
    android:fromAlpha="0"
    android:toAlpha="1"
    android:duration="50"
    android:interpolator="@android:anim/overshoot_interpolator"
    />
    

</set>

با این انیمیشن این عکس زوم میشه میاد بالا و بعد بر میگرده سر جاش اما لبه های پایین عکس وقتی بزرگ میشن میرن زیر لایه ی پایینی و بعد بر میگردن. من می خوام روی لایه قرار بگبرن وقتی دارن زوم میشن.

حالا به نظر شما من باید چجوری عمل کنم؟

 

+3 0
سلام من 8 ماه پیش این سوال را مطرح کردم اما هنوز با چنین انیمیشن هایی مشکل دارم. کسی هست بتونه من رو راهنمایی کنه؟؟ (11 سال پیش)
 برای این سوال 4 پاسخ وجود دارد.
پاسخ به سوال 
Hajhosseini  11 سال پیش
0 0

خوب به لایه بالایی انیمیشن بدید!
اگر نمیتونید به لایه بالایی انیمیشن بدید حتما باید چک کنید که سایزی که زوم میکنید در این لایه بالا جا بشه. مثلا اگر پدینگ داره باید حذف یا کم بشه و از این قبیل کار ها.
باید تست کنید و به جواب برسید، این چیزی نیست که بدونه تست و Run کردن برنامه بشه پاسخ داد.

+1 0
دوست من، یزارین سوالم به یک شکل دیگه بپرسم. ما داخل یک Liner layout سه تا layout داریم حالا میخوام انیمیشنی داشته باشم که لایه ی پایینه بره زیر لایه دوم و بعد این مرحلاه دوتاشون برن زیر لایه اول و از بالا خارج بشن. اما بشکل معمول از پایین به بالا لایه ها روی هم قرار میگیرن . من میخوام یه جورایی اولویت بندی این لایه ها عوض بشه. اینجا باید چی کار کنم دوست عزیز (11 سال پیش)
پاسخ به سوال 
Astro  11 سال پیش
0 0

از متد زیر استفاده کنید:

.bringToFront();
0 0
دوست من از این استفاده کردم اما هیچ تغییری حاصل نمیشه. یا شاید من دارم اشتباه ازش استفاده میکنم. (11 سال پیش)
پاسخ به سوال 
Hajhosseini  11 سال پیش
+2 0

ایندفعه خیلی خوب منظور رو رسوندید.
کافیه به جای استفاده از LinearLayout  از RelativeLayout استفاده کنید.
جای LinearLayout ها رو برعکس کنید یعنی بالایی بیاد پایین
اینجا یک Trick وجود داره، زمانی که شما از RelativeLayout استفاده میکنید میتونید بگید این View رو کنار،زیر،بالا و ... اونیکی View قرار بده.
مکان بالاترین LinearLayout رو مشخص کنید
LinearLayout زیری (دومی) رو به این صورت ست کنید:

 android:layout_below="@+id/linear1"

نکته: حتما باید برای linear1 آیدی اختصاص داده باشید.
اگر از توی property ها بخواید این کار رو انجام بدید:

 Layout:AlignComponent

رو در قسمت top:bottom همون LinearLayout بالایی رو بذارید (linear1)
حالا دومی زیر اولی قرار میگیره ولی اولویت نمایش هنوز با اونیه که تو لیست لایه هاتون پایینه.
بعد از این کار سومی رو هم به زیر دومی قرار بدید.

+1 0
اگر مشکلتون حل شده، به صورت سوال یک حل شده اضافه کنید (11 سال پیش)
0 0
بله دوست من مشکل حل شد ولی یک مشکل یا بهتر بگم سوال دیگه واسم پیش آمد (11 سال پیش)
پاسخ به سوال 
amir Alu  11 سال پیش
0 0

xml را بصورت زیر نوشتم مشکلم حل شد

 <RelativeLayout
android:id="@+id/viewParts"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
android:visibility="visible"

>

<FrameLayout
android:id="@+id/aboutUs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#C06C84"
android:layout_below="@+id/webSite"
android:layout_alignParentBottom="true"
>

<TextView
android:id="@+id/imageView2"
android:layout_width="105dip"
android:layout_height="105dip"
android:layout_gravity="center_vertical"
android:layout_marginBottom="16dip"
android:layout_marginLeft="56dip"
android:layout_marginRight="16dip"
android:layout_marginTop="16dip"
android:background="@drawable/khat" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="19">

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:background="#ffffff">

</LinearLayout>
</LinearLayout>

<LinearLayout
android:layout_width="180dip"
android:layout_height="96dip"
android:layout_gravity="center_vertical|right">

<TextView
android:id="@+id/textView3"
android:layout_width="8dip"
android:layout_height="match_parent"
android:layout_marginBottom="12dip"
android:layout_marginTop="12dip"
android:background="#00FFFF" />

<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="6dip"
android:gravity="left"
android:text="درباره طراح\nو سازنده"
android:textColor="#ffffff"
android:textSize="30sp" />
</LinearLayout>
</FrameLayout>
<FrameLayout
android:id="@+id/webSite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#6C5B7B"
android:layout_below="@+id/aboutUni">

<TextView
android:id="@+id/imageView2"
android:layout_width="105dip"
android:layout_height="105dip"
android:layout_gravity="center_vertical"
android:layout_marginBottom="16dip"
android:layout_marginLeft="56dip"
android:layout_marginRight="16dip"
android:layout_marginTop="16dip"
android:background="@drawable/web1" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="19">

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:background="#ffffff">

</LinearLayout>
</LinearLayout>

<LinearLayout
android:layout_width="180dip"
android:layout_height="96dip"
android:layout_gravity="center_vertical|right"
>

<TextView
android:id="@+id/textView3"
android:layout_width="8dip"
android:layout_height="match_parent"
android:layout_marginBottom="12dip"
android:layout_marginTop="12dip"
android:background="#F67281" />

<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="6dip" android:gravity="left"
android:text="وب سایت\nدانشگاه"
android:textColor="#ffffff"
android:textSize="32sp" />
</LinearLayout>
</FrameLayout>
<FrameLayout
android:id="@+id/aboutUni"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#355C7D"
android:layout_alignParentTop="true" >

<TextView
android:id="@+id/imageView2"
android:layout_width="105dip"
android:layout_height="105dip"
android:layout_gravity="center_vertical"
android:layout_marginBottom="16dip"
android:layout_marginLeft="56dip"
android:layout_marginRight="16dip"
android:layout_marginTop="16dip"
android:background="@drawable/uni1" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="19" >
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:background="#ffffff" >
</LinearLayout>
</LinearLayout>

<LinearLayout
android:layout_width="180dip"
android:layout_height="96dip"
android:layout_gravity="center_vertical|right" >

<TextView
android:id="@+id/textView3"
android:layout_width="8dip"
android:layout_height="match_parent"
android:layout_marginBottom="12dip"
android:layout_marginTop="12dip"
android:background="#FEB594" />

<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="6dip"
android:gravity="left"
android:text="معرفی\nدانشگاه"
android:textColor="#ffffff"
android:textSize="32sp" />
</LinearLayout>
</FrameLayout>




</RelativeLayout>

ولی یک سوال دیگه پیش آمد.  چطور تنظیم کنم که بتونم به frameLayout ها وزن بدم که دقیقا هر کدوم 1/3 فضا رو اشغال کنه...؟

+2 0
هر FrameLayout رو در یک LinearLayout قرار بدید. (11 سال پیش)
+1 0
لطفا از صفحه ای که میخواید درست کنید عکس بگیرید و درج کنید، این توضیحاتی که دادید کامل نیست، کدتون هم نشانگر چیزی که میخواید درست کنید نیست. (11 سال پیش)
0 0
درباره این که گفتید :(( هر FrameLayout رو در یک LinearLayout قرار بدید )) شدنی نیست اخه لایه های داخل RelativeLAyout نمیتونن Layout_weight بهشون داد. (11 سال پیش)
0 0
عکسی ازش ندارم فقط یک flash ازش درست کردم واسه نمونه که میتونم واستون ایمیل کنم (11 سال پیش)
0 0
امیر جان اگر مشکلت حل نشد برام ارسال کن تا کمکت کنم. ایمیل پ خ شد. ایمیل کردی در همین سایت پیام بده، چون ایمیل هام رو فقط روزی یکبار اول صبح چک میکنم (11 سال پیش)

پاسخگویی و مشاهده پاسخ های این سوال تنها برای اعضای ویژه سایت امکان پذیر است .
چنانچه تمایل دارید به همه بخش ها دسترسی داشته باشید میتوانید از این بخش لایسنس این آموزش را خریداری نمایید .