ورود

View Full Version : مشکل در اسکرول



slr560
یک شنبه 15 تیر 1393, 21:04 عصر
سلام دوستان
من این اسکرول رو هر جایی که میزارم ایراد میگیره
یکی میشه کمکم کنه کجا بزارمش که به صورت vertical اسکرول داشته باشم؟؟؟


<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:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="ir.darabifard.daneshjo.RegisterActivity">




<EditText
android:layout_width="150dp"
android:layout_height="wrap_content"
android:id="@+id/txt_name_register"
android:hint="نام"
android:inputType="text"
android:layout_alignParentRight="true"
android:layout_marginTop="0dp"/>


<EditText
android:layout_width="170dp"
android:layout_height="wrap_content"
android:id="@+id/txt_lastname_register"
android:hint="نام خانوادگی"
android:inputType="text"
android:layout_alignParentRight="true"
android:layout_marginTop="50dp"/>


<EditText
android:layout_width="170dp"
android:layout_height="wrap_content"
android:id="@+id/txt_num_stu_register"
android:hint="شماره دانشجویی"
android:inputType="number"
android:layout_alignParentRight="true"
android:layout_marginTop="100dp"/>


<EditText
android:layout_width="170dp"
android:layout_height="wrap_content"
android:id="@+id/txt_education_register"
android:hint="تحصیلات"
android:inputType="text"
android:layout_alignParentRight="true"
android:layout_marginTop="150dp"/>


<EditText
android:layout_width="90dp"
android:layout_height="wrap_content"
android:id="@+id/txt_sex_register"
android:hint="جنسیت"
android:inputType="text"
android:layout_alignParentRight="true"
android:layout_marginTop="200dp"/>


<EditText
android:layout_width="140dp"
android:layout_height="wrap_content"
android:id="@+id/txt_shenasname_register"
android:hint="ش.شناسنامه"
android:inputType="number"
android:layout_alignParentRight="true"
android:layout_marginTop="250dp"/>


<EditText
android:layout_width="140dp"
android:layout_height="wrap_content"
android:id="@+id/txt_shomare_meli_register"
android:hint="ش.ملی"
android:inputType="number"
android:layout_alignParentRight="true"
android:layout_marginTop="300dp"/>


<EditText
android:layout_width="120dp"
android:layout_height="wrap_content"
android:id="@+id/txt_ostan_register"
android:hint="استان"
android:inputType="text"
android:layout_alignParentRight="true"
android:layout_marginTop="350dp"/>


<EditText
android:layout_width="120dp"
android:layout_height="wrap_content"
android:id="@+id/txt_shahr_register"
android:hint="شهر"
android:inputType="text"
android:layout_alignParentRight="true"
android:layout_marginTop="400dp"/>


<EditText
android:layout_width="160dp"
android:layout_height="wrap_content"
android:id="@+id/txt_mobile_register"
android:hint="موبایل"
android:inputType="number"
android:layout_alignParentRight="true"
android:layout_marginTop="450dp"/>


<Button
android:layout_width="100dp"
android:layout_height="50dp"/>




</RelativeLayout>

badname
یک شنبه 15 تیر 1393, 22:31 عصر
به این فرم استفاده کن



<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollView01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>




<RelativeLayout
android:id="@+id/RelativeLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>


<LinearLayout
android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>

<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#ffffff" />


<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>

</LinearLayout>

</RelativeLayout>
</ScrollView>

badname
یک شنبه 15 تیر 1393, 22:33 عصر
فرم کلی اینه که اسکرول ویو داشته باشی بعد لی اوت و تکست ویو و ... داخلش قرار بدی
راه های دیگه ای ام هست ....
همین کارتو راه میندازه

slr560
یک شنبه 15 تیر 1393, 22:41 عصر
الان تکست های بالا تمام صفحه رو گرفتن
حالا میخوام یه باتن اضافه کنم پایینش ولی پایین نمیره. هی میپره میره سمت چپ
اسکرول درست شد. چیکار کنم باتن بره زیره تکست ها؟
چجوری align کنم ؟ relative layout هست

badname
یک شنبه 15 تیر 1393, 23:11 عصر
الان تکست های بالا تمام صفحه رو گرفتن
حالا میخوام یه باتن اضافه کنم پایینش ولی پایین نمیره. هی میپره میره سمت چپ
اسکرول درست شد. چیکار کنم باتن بره زیره تکست ها؟
چجوری align کنم ؟ relative layout هست
اینو بزن تو Button تو id هاشم آیدی آیتم بالاییشو بدی فک کنم دیگه مشکل نداشته باشی :لبخندساده:



android:layout_alignLeft="@+id/b"
android:layout_alignRight="@+id/b"
android:layout_below="@+id/b"

slr560
یک شنبه 15 تیر 1393, 23:17 عصر
اینو بزن تو Button تو id هاشم آیدی آیتم بالاییشو بدی فک کنم دیگه مشکل نداشته باشی :لبخندساده:



android:layout_alignLeft="@+id/b"
android:layout_alignRight="@+id/b"
android:layout_below="@+id/b"


مرسی دوست من با below درست شد
میشه بگی below واسه چی هست؟

slr560
یک شنبه 15 تیر 1393, 23:23 عصر
یه سوال دیگه هم داشتم
من وقتی فونت yekan رو میدم به edit text ها میاد عدد هارو به صورت فارسی (۱۲۳۴۵۶۷۸) نشون میده
آیا این وقتی توی دیتا بیس ذخیره بشه مشکلی نداره؟
یا مثلا در کد نویسی برای مقایسه مشکلی پیش نمیاد؟ چون یادمه تو بعضی جاها قبلا گیر میداد

badname
یک شنبه 15 تیر 1393, 23:23 عصر
مرسی دوست من با below درست شد
میشه بگی below واسه چی هست؟
مشخصه دیگه الان چیکار کرد واسه همونه :لبخند:
هرآیتمیو خواستی ببری زیر یه چیز دیگه below میکنی رو بالاییش :لبخندساده:

badname
یک شنبه 15 تیر 1393, 23:29 عصر
اینو دقیقا نمیدونم برام پیش نیومده
ولی منطقیه که وقتی از فونت استفاده میکنی ظاهر فقط تغییر میکنه به نظرم باطنش همونیه که وارد کردی

slr560
دوشنبه 16 تیر 1393, 10:03 صبح
اینجا الان من یه ۷تا EditText دارم . زیاد جالب نیست بیام توی فایل جاوا یه TypeFace تعریف کنم و فونت همشونو دونه دونه تغییر بدم
آیا راهی چیزی هست که به صورت Style در XML بتونم فونت مربوط رو بهشون لینک بدم ؟ میشه از xml کاری کرد؟

badname
دوشنبه 16 تیر 1393, 11:25 صبح
اینجا الان من یه ۷تا EditText دارم . زیاد جالب نیست بیام توی فایل جاوا یه TypeFace تعریف کنم و فونت همشونو دونه دونه تغییر بدم
آیا راهی چیزی هست که به صورت Style در XML بتونم فونت مربوط رو بهشون لینک بدم ؟ میشه از xml کاری کرد؟
یجایی یه typeface دیدم که یجوری استفاده شده بود که واسه همه متد ها کار میکرد ، ولی حقیقتش یادم رفته چجوری استفاده میشد
پیدا کردی اینجا هم بزار

slr560
دوشنبه 16 تیر 1393, 11:33 صبح
یجایی یه typeface دیدم که یجوری استفاده شده بود که واسه همه متد ها کار میکرد ، ولی حقیقتش یادم رفته چجوری استفاده میشد
پیدا کردی اینجا هم بزار

منم خیلی گشتم. چیزی نبود که از xml بشه درست کرد. میشه مثلا یه کلاس ادیت تکست ساخت که از EditText مشتق شده باشه. تغییرات رو روی این کلاس انجام میدیم و به اندازه ی آبجکت های صفحه از این کلاس مشتق میکنیم
اینجوری دیگه نمیخواد دونه دونه تغییرات رو اعمال کنیم.