需要在一个屏幕上面实现类似布局------------------------------
TextView
------------------------------
Gallery
------------------------------
LinearLayout
ImageView ImageView
------------------------------但是gallery必须设置为fill_parent
请问有没有比较合适的layout可以使用都使用LinearLayout之后 gallery会没有滑动效果
如果XML可用 立即结贴给分
TextView
------------------------------
Gallery
------------------------------
LinearLayout
ImageView ImageView
------------------------------但是gallery必须设置为fill_parent
请问有没有比较合适的layout可以使用都使用LinearLayout之后 gallery会没有滑动效果
如果XML可用 立即结贴给分
<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的高度 这样才行看来还是要看代码是王道