View Full Version : لایوت با اسکرول افقی
EHSAN99100
جمعه 20 شهریور 1394, 22:37 عصر
دوستان من برای نوشتن اپ نیاز به برنامه نویسی همچین اپی دارم که مطابق تصویر زیر باشه . کسی می تونه راهنمایی کنه چطور بنویسمش؟
135169
اینا یکسری تصایر هستن که اینجوری کنار هم چیده شده اند و نمای لایوت لنداسکیپه و اسکرول افقی میخوره.
iran_sun99
شنبه 21 شهریور 1394, 09:32 صبح
سلام دوست عزیز
میتونی از Gridview استفاده کنی
gilas1368
شنبه 21 شهریور 1394, 12:38 عصر
سلام دوست عزیز
میتونی از Gridview استفاده کنی
والا تا جایی ک من میدونم و کار کردم gridview توی صفحه fit میشه
اگر تغییرش دادن جدیدا من در جریان نیستم
اما در پاسخ سوال دوستمون باید بگم شما دو راه دارید
1- استفاده از view pager
2- استفاده از horizontal scroll view
هر جفتش رو اگ ی گوگل انجام بدید میتونید sampleها و libraryهایی ک وجود داره براش رو پیدا کنین، میتونید از ابزارهای پیشفرض خود ideاتون هم استفاده کنین
EHSAN99100
شنبه 21 شهریور 1394, 12:56 عصر
ممنون
مشکل اینه که نمی دونم چه کلیدواژه ای رو سرچ کنم.
EHSAN99100
شنبه 21 شهریور 1394, 22:00 عصر
کسی می تونه اینو برای من بنویسه لطفا قیمت مورد نظرش رو برام پیام خصوصی بده
MansoorJ
شنبه 21 شهریور 1394, 22:03 عصر
سلام
به نظرم از HorizontalScrollView استفاده کنید.
<HorizontalScrollView android:layout_height="fill_parent" android:layout_width="fill_parent" android:id="@+id/horizontalScrollView1" android:layout_marginTop="5dp" android:focusableInTouchMode="true" android:layout_marginBottom="5dp" android:layout_centerHorizontal="true"><LinearLayout android:layout_height="match_parent" android:layout_width="match_parent" android:id="@+id/linearLayout" android:orientation="horizontal"> </LinearLayout></HorizontalScrollView>
و شما میتونید داخل LinearLayout کد های رو که می خواید بنویسید
حالا یا داخل xml یا داخل فایل جاوا بصورت کد نویسی.
EHSAN99100
شنبه 21 شهریور 1394, 23:43 عصر
ممنون تا اینجا یکم شبیه شد ولی الان مشکلی که هست اینه که سایز هر خونه دست من نیست .
برای اینکه عرضشون بزرگتر بشه باید چیکار کنم؟
135193
MansoorJ
یک شنبه 22 شهریور 1394, 07:54 صبح
یا عرض باتن رو تغییر بدید یا LinearLayout
هم چنین می تونید به جای LinearLayout از RelateviLayout استفاده کنید.
EHSAN99100
یک شنبه 22 شهریور 1394, 09:45 صبح
RelateviLayout که می گذارم هیچ فرقی نمی کنه.
منظورتون اینه که عرض LinearLayout رو عددی بگذارم؟ خوب بعد اینجوری رسپانسیو نمی شه.
این که منه:
<LinearLayout android:layout_height="match_parent"
android:layout_width="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal">
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal" >
<Button
android:id="@+id/button2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FF2200"
android:layout_weight="1.0"
android:text="Button" />
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:layout_weight="1.0"
android:text="Button" />
<Button
android:id="@+id/button2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FF2200"
android:layout_weight="1.0"
android:text="Button" />
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:layout_weight="1.0"
android:text="Button" />
<Button
android:id="@+id/button2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FF2200"
android:layout_weight="1.0"
android:text="Button" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal"
>
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:layout_weight="0.1"
android:text="Button" />
<Button
android:id="@+id/button2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FF2200"
android:layout_weight="0.1"
android:text="Button" />
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:layout_weight="0.1"
android:text="Button" />
<Button
android:id="@+id/button2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FF2200"
android:layout_weight="0.1"
android:text="Button" />
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:layout_weight="0.1"
android:text="Button" />
</LinearLayout>
</LinearLayout>
</HorizontalScrollView>
</LinearLayout>
vBulletin® v4.2.5, Copyright ©2000-1403, Jelsoft Enterprises Ltd.