من یه ImageViewبزرگ رو میزارم تو activity و اون رو داخل یه ScrollView ولی فقط scroll عمودی رو نشون میده.
ممنون میشم کسی راهنماییم کنه
من یه ImageViewبزرگ رو میزارم تو activity و اون رو داخل یه ScrollView ولی فقط scroll عمودی رو نشون میده.
ممنون میشم کسی راهنماییم کنه
از ویو های تو در تو استفاده کن
در داخل 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>
ممنون ولی این فقط عمودی scroll میکنه و افقی عکس stretch میشه .
در حالی که من میخام کل عکس با سایز واقعیش باشه و عمودی و افقی scroll بخوره
از این استفاده کن
<?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>