需要在一个屏幕上面实现类似布局------------------------------
TextView
------------------------------
Gallery
------------------------------
LinearLayout
ImageView ImageView
------------------------------但是gallery必须设置为fill_parent
请问有没有比较合适的layout可以使用都使用LinearLayout之后 gallery会没有滑动效果
如果XML可用 立即结贴给分
TextView
------------------------------
Gallery
------------------------------
LinearLayout
ImageView ImageView
------------------------------但是gallery必须设置为fill_parent
请问有没有比较合适的layout可以使用都使用LinearLayout之后 gallery会没有滑动效果
如果XML可用 立即结贴给分
解决方案 »
- 如何知道一个应用程序被打开或关闭?
- 我写了一个HorizontalScrollView,是动态的添加子项,该怎么让其自动显示刚添加的子项,
- android 关于锁屏,解屏之后游戏重新运行而不是继续运行
- 有用过百度统计的进,求大神指点
- 多张图片在屏幕里自由浮动,没事帮顶 谢谢
- Android传感器API之:方向SensorOrientation传感器功能实现与源码分享
- R cannot be resolved to a variable
- 一个与robotium有关的问题,求大神帮助!
- 关于android实现button的问题
- 安卓百度地图 出现的问题 求解
- 为何F3,源码不源码?
- 生成文件名中文命名的问题
<LinearLayout android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TextView></TextView>
<Gallery android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center">
</Gallery>
</LinearLayout>
公司项目截的, 只给架构
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<Gallery
android:id="@+id/gallery"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"
/>
</LinearLayout>上面的试过了,有滑动效果啊。
android:layout_height="wrap_content"那么Gallery也可以是:
android:layout_height="fill_parent"
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id = "@+id/layout_root"
android:orientation = "vertical"
android:layout_width="320dip"
android:layout_height="480dip">
<TextView android:text="请输入账号" android:id="@+id/account_view" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#FFFFFF"
android:textSize = "28dip" android:layout_marginLeft="10dip" android:layout_marginRight="10dip" ></TextView>
<Gallery
android:layout_width="fill_parent"
android:layout_height="200dip"
android:background="@drawable/icon"
android:layout_marginTop="10dip"> </Gallery>
<TextView android:text="请输入密码" android:id="@+id/paw_view" android:layout_width="fill_parent" android:layout_height="wrap_content"
android:textSize = "28dip" android:background="#FFFFFF" android:singleLine="false"></TextView>
<LinearLayout android:layout_width="wrap_content" android:id="@+id/linearLayout1" android:layout_height="wrap_content" android:orientation = "horizontal"
android:layout_marginBottom = "20dip" android:layout_marginTop = "20dip">
<ImageButton android:layout_width="wrap_content" android:src="@drawable/icon" android:id="@+id/login_ok" android:layout_height="50dip"
></ImageButton>
<ImageButton android:layout_width="wrap_content" android:src="@drawable/icon" android:id="@+id/login_back" android:layout_height="50dip"
android:layout_marginLeft = "70dip" android:layout_marginRight = "10dip"></ImageButton>
</LinearLayout>
</LinearLayout>
这是根据我的图片,大致弄的。我看你明明都知道啊。。给我分吧,你看我容易吗
在里面最后才计算gallery的高度 这样才行看来还是要看代码是王道