ScrollView解决办法
ScrollView
我想用ScrollView实现图片的水平滚动的功能,用ImageButton放图片的 可是就是不能全屏 请高手帮忙啊
配置文件
------解决方案--------------------
你是图片的话为什么不用Gallery
------解决方案--------------------
你是想让当前的图片除了隐藏之外,还要占满整个屏幕吗?
如果这样的话,我没做过,不过我想用可以用获取当前手机的hight和whight,然后赋给当前图片的大小。应该可以实现,不过估计不好看了。
你刚说的那个应用像11楼说的用gallary更好
我想用ScrollView实现图片的水平滚动的功能,用ImageButton放图片的 可是就是不能全屏 请高手帮忙啊
- Java code
package my.scrollview; import android.app.Activity; import android.os.Bundle; import android.view.WindowManager.LayoutParams; import android.widget.ImageButton; import android.widget.LinearLayout; public class ScrollviewActivity extends Activity { private LinearLayout linear = null; private ImageButton img = null; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } }
配置文件
- XML code
<?xml version="1.0" encoding="utf-8"?> <HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:fillViewport="true" > <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" android:id="@+id/linear" > <ImageButton android:id="@+id/img" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_gravity="center_vertical" android:src="@drawable/p3" /> <ImageButton android:id="@+id/img1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_gravity="center_vertical" android:src="@drawable/p1" /> <ImageButton android:id="@+id/img2" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_gravity="center_vertical" android:src="@drawable/p2" /> <ImageButton android:id="@+id/img3" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_gravity="center_vertical" android:src="@drawable/p4" /> <ImageButton android:id="@+id/img4" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_gravity="center_vertical" android:src="@drawable/p6" /> </LinearLayout> </HorizontalScrollView>
------解决方案--------------------
你是图片的话为什么不用Gallery
------解决方案--------------------
你是想让当前的图片除了隐藏之外,还要占满整个屏幕吗?
如果这样的话,我没做过,不过我想用可以用获取当前手机的hight和whight,然后赋给当前图片的大小。应该可以实现,不过估计不好看了。
你刚说的那个应用像11楼说的用gallary更好