当前位置:编程学习 > wap >>

关于布局的问题



请问如何将这根黄色的滚动条放到最右边呢?者离右边的距离很近。
布局的代码如下:<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:gravity="center_vertical"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/channel_list_logo"
        android:layout_width="190dip"
        android:layout_height="108dip"
        android:focusable="false"
        android:layout_gravity="center_horizontal"
        android:adjustViewBounds="true" />

    <TextView
        android:id="@+id/channel_list_name"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:gravity="center"
        android:paddingBottom="3dip"
        android:singleLine="true"
        android:textColor="@drawable/channel_program_color"
        android:textSize="20dp" />
</LinearLayout>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <GridView
        android:id="@+id/test_gridview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginLeft="30dp"
        android:layout_marginRight="30dp"
        android:layout_marginTop="30dp"
        android:alwaysDrawnWithCache="true"
        android:scrollbars="vertical"
        android:background="@color/semitransparent"
        android:columnWidth="80dp"
        android:gravity="center"
        android:padding="30dip"
        android:horizontalSpacing="10dp"
        android:listSelector="@drawable/channel_list_sl"
        android:numColumns="5"
android:scrollbarThumbVertical="@drawable/scroll_bgcolor1"
android:scrollbarTrackVertical="@drawable/scroll_bgcolor"
        android:verticalSpacing="10dp" />

</RelativeLayout>
请问需要加些什么属性才能达到我想要的那种效果呢??? --------------------编程问答-------------------- 用RelateLayout吧 --------------------编程问答-------------------- 最外层的布局用RelateLayout好设计点... --------------------编程问答-------------------- 你的滚动条离右边很远是不是GridView的android:padding="30dip"造成的啊?
这里设成0不就行了? --------------------编程问答--------------------
引用 3 楼  的回复:
你的滚动条离右边很远是不是GridView的android:padding="30dip"造成的啊?
这里设成0不就行了?

不是的,我删除后还是那样的 --------------------编程问答--------------------
引用 1 楼  的回复:
用RelateLayout吧

我换成RelativeLayout这个了,可还是没变化啊 --------------------编程问答--------------------

android:gravity="right"
--------------------编程问答-------------------- 对滴
引用 6 楼  的回复:
Java code

android:gravity="right"
--------------------编程问答-------------------- 你是不是设置了居中啊?给他主动设置到右边去试一试呢!android:gravity="right"
补充:移动开发 ,  Android
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,