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

یک برنامه کامل نوشتم آمادست ، فقط توی گرافیکش مشکل دارم!

oMiD4gApp  9 سال پیش  9 سال پیش
0 0

مجددا سلام

دوستان بنده بعد کلی جون کندن یه برنامه رو کامل کردم و گرافیکش(که فقط اضافه کردن چندتا عکس هست)منو درگیر کرده

برنامه ای که نوشتم یه اکتیوینی اصلی داره که توی این اکتیویتی تعدادی باتن ایمیج وجود داره و با کلیک هر کدوم به اکتیویتیش میری

الان من نمیدونم چطوری باتن ایمیج یا عکس قابل کلیک درست کنم که مشکلی نداشته باشه...هر کاری میکنم تو صفحات مختلف بهم میریزه

 

دقیقا اکتیویتی اولم میخوام اینطوری باشه و با کلیک روی هر کدوم بریم تو اکتیویتی موردنظر :(

خستم کرده

+1 0
بسته به طرز کار خودتون داره ، بهترین راه به نظر من استفاده از گرید ویو هست و به خصوص اگر اون رو سفارشی کنین توی انجمن سرچ کنید به احتمال زیاد وجود داره در غیر اینصورت هم میتونین داخل گوگل سرچ کنید که منابع بسیار زیاد هستند (9 سال پیش)
0 0
با گرید ویو دیگه مشکلات ست نشدن عکس و ... حل میشه؟ ضمنا عکس هایی که بذارم توش باید چه سایزهایی رو از قبل درون چه پوشه هایی بذارم ممنون..چون من خودم چند بار سعی کردم عکس میذاشتم اما باز بی کیفیت میشد (9 سال پیش)
+1 0
من که نفهمیدم مشکلتون چیه؟ خوب عکساتون رو میچینید بعد هم واسشون ایدی و بعد هم رویداد کلیک تعریف میکنید دیگه... (9 سال پیش)
0 0
خب عکسارو چطور بچینم.کلا با عکس مشکل دارم اول اینکه عکسا دارای چه سایز در کدوم پوشه ها باشن من عکسارو میچینم تو سایز مختلف اندازشون تغییر نمیکنه و همونقدر کوچیک میمونن (9 سال پیش)
+1 0
از پنجره properties طول و عرض عکسا رو تغییر بده . (9 سال پیش)
 برای این سوال 2 پاسخ وجود دارد.
پاسخ به سوال 
oMiD4gApp  9 سال پیش
0 0

این درست من عرضون رو درست میکنم اما توی ارتفاعشون توی گوشی های مختلف سرجاشون میمونه !؟

 

عکس اول که صفحه کوچیک هست همه چی درسته اما عکس دوم که صفحه بزرگ هست اینشکلی میشه

0 0
خوب شما اول به ازای هر عکس ، یک لی اوت تعریف کن. به لی اوت ها وزن بده .سپس هر عکس رو داخل یک لی اوت بنداز. اینجوری دیگه به هم نمیریزه (9 سال پیش)
0 0
< ?xml versi encoding="utf-8"?> (9 سال پیش)
پاسخ به سوال 
fanta  9 سال پیش
+1 0

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    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_gravity="center" android:layout_weight=".2">

        <LinearLayout
            android:layout_width="0dip"
            android:layout_height="match_parent" android:layout_weight=".25" android:gravity="center">

            <ImageView
                android:id="@+id/imageView1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_launcher" />

        </LinearLayout>

        <LinearLayout
            android:layout_width="0dip"
            android:layout_height="match_parent" android:layout_weight=".25" android:gravity="center">

            <ImageView
                android:id="@+id/imageView2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_launcher" />

        </LinearLayout>

        <LinearLayout
            android:layout_width="0dip"
            android:layout_height="match_parent" android:layout_weight=".25" android:gravity="center">

            <ImageView
                android:id="@+id/imageView3"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_launcher" />

        </LinearLayout>

        <LinearLayout
            android:layout_width="0dip"
            android:layout_height="match_parent" android:layout_weight=".25" android:gravity="center">

            <ImageView
                android:id="@+id/imageView4"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_launcher" />

        </LinearLayout>

    </LinearLayout>


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dip"
        android:layout_gravity="center"
        android:layout_weight=".2" >

        <LinearLayout
            android:layout_width="0dip"
            android:layout_height="match_parent"
            android:layout_weight=".25"
            android:gravity="center" >

            <ImageView
                android:id="@+id/ImageView01"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_launcher" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="0dip"
            android:layout_height="match_parent"
            android:layout_weight=".25"
            android:gravity="center" >

            <ImageView
                android:id="@+id/ImageView02"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_launcher" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="0dip"
            android:layout_height="match_parent"
            android:layout_weight=".25"
            android:gravity="center" >

            <ImageView
                android:id="@+id/ImageView03"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_launcher" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="0dip"
            android:layout_height="match_parent"
            android:layout_weight=".25"
            android:gravity="center" >

            <ImageView
                android:id="@+id/ImageView04"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_launcher" />
        </LinearLayout>
    </LinearLayout>



    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dip"
        android:layout_gravity="center"
        android:layout_weight=".2" >

        <LinearLayout
            android:layout_width="0dip"
            android:layout_height="match_parent"
            android:layout_weight=".25"
            android:gravity="center" >

            <ImageView
                android:id="@+id/ImageView05"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_launcher" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="0dip"
            android:layout_height="match_parent"
            android:layout_weight=".25"
            android:gravity="center" >

            <ImageView
                android:id="@+id/ImageView06"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_launcher" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="0dip"
            android:layout_height="match_parent"
            android:layout_weight=".25"
            android:gravity="center" >

            <ImageView
                android:id="@+id/ImageView07"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_launcher" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="0dip"
            android:layout_height="match_parent"
            android:layout_weight=".25"
            android:gravity="center" >

            <ImageView
                android:id="@+id/ImageView08"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_launcher" />
        </LinearLayout>
    </LinearLayout>



    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dip"
        android:layout_gravity="center"
        android:layout_weight=".2" >

        <LinearLayout
            android:layout_width="0dip"
            android:layout_height="match_parent"
            android:layout_weight=".25"
            android:gravity="center" >

            <ImageView
                android:id="@+id/ImageView09"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_launcher" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="0dip"
            android:layout_height="match_parent"
            android:layout_weight=".25"
            android:gravity="center" >

            <ImageView
                android:id="@+id/ImageView10"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_launcher" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="0dip"
            android:layout_height="match_parent"
            android:layout_weight=".25"
            android:gravity="center" >

            <ImageView
                android:id="@+id/ImageView11"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_launcher" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="0dip"
            android:layout_height="match_parent"
            android:layout_weight=".25"
            android:gravity="center" >

            <ImageView
                android:id="@+id/ImageView12"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_launcher" />
        </LinearLayout>
    </LinearLayout>



    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dip"
        android:layout_gravity="center"
        android:layout_weight=".2" >

        <LinearLayout
            android:layout_width="0dip"
            android:layout_height="match_parent"
            android:layout_weight=".25"
            android:gravity="center" >

            <ImageView
                android:id="@+id/ImageView13"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_launcher" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="0dip"
            android:layout_height="match_parent"
            android:layout_weight=".25"
            android:gravity="center" >

            <ImageView
                android:id="@+id/ImageView14"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_launcher" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="0dip"
            android:layout_height="match_parent"
            android:layout_weight=".25"
            android:gravity="center" >

            <ImageView
                android:id="@+id/ImageView15"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_launcher" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="0dip"
            android:layout_height="match_parent"
            android:layout_weight=".25"
            android:gravity="center" >

            <ImageView
                android:id="@+id/ImageView16"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_launcher" />

        </LinearLayout>
    </LinearLayout>

</LinearLayout>

0 0
دوست عزیز این کد رو توی xml کپی کن.خودم درست کردم واست.فقط شما عکسا رو جایگزین کن (9 سال پیش)
0 0
بسیار سپاسگذار..عالی بود فقط یه مسله ای ، من سایز عکس ها رو الان 120 پیکسل درست کردم فقط گذاشتم تو xhdpi ..این سایز خوبه یا بزرگترش کنم و توی بقیه پوشه ها چه سایزی بذارم؟ نیاز به پوشه xxhdpi هست؟ چون روی امولیتور کلا کیفیت پایین هست مشخص نمیشه عکسا کیفیتشون خوب نشون میده یا نه (9 سال پیش)
0 0
و یک سوال دیگه....چیکار کنیم که بعد کلیک روی هر عکس شبیه دکمه که کلیک میشه یه حالت فشاری روش نمایش بده...با onsetclick , onsettouch نشد :/ (9 سال پیش)
0 0
در مورد سوال اول ، روی گوشی تست بگیر اگه کیفیتش خوب بود که هیچ ،اگه نه از عکس های با کیفیت بالاتر استفاده کن. (9 سال پیش)
0 0
در مورد سوال دوم هم ،کار پیچیده میشه و توضیح دادنش اینجا خیلی سخته (9 سال پیش)

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