View Full Version : قرار دادن عکس بزرگ با scroll
djscsi
جمعه 12 اردیبهشت 1393, 12:46 عصر
من یه ImageViewبزرگ رو میزارم تو activity و اون رو داخل یه ScrollView ولی فقط scroll عمودی رو نشون میده.
ممنون میشم کسی راهنماییم کنه
mf2009
جمعه 12 اردیبهشت 1393, 14:02 عصر
از ویو های تو در تو استفاده کن
در داخل ScroolView خود یه RelativeLayout قرار بده و عکس رو داخل RelativeLayout بذار مثل مثال زیر در ضمن اندازه عکس رو هم عرضش رو fill_parent کن و ارتفاعش رو هر چقدر که دوست داری
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:background="@drawable/backback"
>
<RelativeLayout
android:layout_height="fill_parent"
android:layout_width="fill_parent"
>
<ImageView
android:id="@+id/btn17"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/afzayeshvazna"
android:background="@null"
android:paddingTop="30dp"
android:layout_centerHorizontal="true"
/>
</RelativeLayout>
</ScrollView>
djscsi
جمعه 12 اردیبهشت 1393, 17:35 عصر
ممنون ولی این فقط عمودی scroll میکنه و افقی عکس stretch میشه .
در حالی که من میخام کل عکس با سایز واقعیش باشه و عمودی و افقی scroll بخوره
mf2009
جمعه 12 اردیبهشت 1393, 18:38 عصر
از این استفاده کن
<?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" >
<ScrollView
android:id="@+id/layout"
android:layout_height="match_parent"
android:scrollbars="horizontal|vertical"
android:layout_width="match_parent"
android:layout_marginTop="5dip"
android:scrollbarStyle="outsideInset"
android:fillViewport="true">
<HorizontalScrollView
android:id="@+id/horizontalView"
android:layout_height="wrap_content"
android:scrollbars="horizontal|vertical"
android:layout_width="wrap_content" android:layout_marginTop="5dip">
</HorizontalScrollView>
</ScrollView>
</LinearLayout>
rubiks.kde
شنبه 13 اردیبهشت 1393, 11:22 صبح
من یه ImageViewبزرگ رو میزارم تو activity و اون رو داخل یه ScrollView ولی فقط scroll عمودی رو نشون میده.
ممنون میشم کسی راهنماییم کنه
به نمونه برنامه های کوچک و مفید مراجعه کنید
vBulletin® v4.2.5, Copyright ©2000-1404, Jelsoft Enterprises Ltd.