开发者

Adding a thin vertical image above the scroll view

I have a vertical scroll view which has different images scrolling horizontally. Now , what I want to do is add a badge or strip above the scroll view. Just like a wrapping strap above the scroll view and it is going to be an image.

Here is the xml file if it helps:

<LinearLayout android:layout_marginLeft="200dp"
    android:layout_height="280dp" android:layout_width="wrap_content"
    android:background="@drawable/border1">
    <ScrollView android:id="@+id/scrollMain"
        android:layout_width="wrap_content" android:layout_gravity="center_vertical"
        android:layout_height="250px" android:fillViewport="false">
        <LinearLayout android:id="@+id/LinMid"
            android:layout_height="fill_parent" android:layout_width="fill_parent"
            android:orientation="vertical" android:layout_marginLeft="20px"
            android:layout_marginRight="20px" android:layout_marginBottom="20px">
            <LinearLayout android:id="@+id/image_list_one"
                android:layout_marginLeft="20dp" android:layout_height="200dp"
                android:orientation="horizontal" android:layout_width="800dp"
                android:background="@drawable/search_arrow_left"
                android:layout_weight="0.17">
                <LinearLayout android:layout_height="130dp"
                    android:orientation="vertical" android:layout_width="wrap_content"
                    android:layout_marginTop="70px" android:layout_margi开发者_如何学PythonnLeft="60px">
                    <ImageView android:layout_height="wrap_content"
                        android:src="@drawable/txt_keo" android:layout_width="wrap_content"></ImageView>
                </LinearLayout>
                <View android:layout_height="130dp" android:layout_width="50dp"></View>
                <LinearLayout android:layout_height="200dp"
                    android:orientation="vertical" android:layout_width="wrap_content"
                    android:gravity="center_vertical" android:layout_marginTop="20px">
                    <ImageView android:layout_height="wrap_content"
                        android:src="@drawable/txt_blahblah" android:layout_width="wrap_content"></ImageView>
                </LinearLayout>
                <View android:layout_height="130dp" android:layout_width="35dp"></View>
                <LinearLayout android:layout_height="200dp"
                    android:orientation="vertical" android:layout_width="wrap_content"
                    android:gravity="center_vertical">
                    <ImageView android:layout_width="wrap_content"
                        android:src="@drawable/image_btl2" android:layout_height="200dp"
                        android:layout_gravity="center_vertical"></ImageView>
                </LinearLayout>
            </LinearLayout>
            <LinearLayout android:id="@+id/image_list_one"
                android:layout_marginLeft="20dp" android:layout_height="200dp"
                android:orientation="horizontal" android:layout_width="800dp"
                android:background="@drawable/search_arrow_left"
                android:layout_weight="0.17">
                <LinearLayout android:layout_height="130dp"
                    android:orientation="vertical" android:layout_width="wrap_content"
                    android:layout_marginTop="70px" android:layout_marginLeft="60px">
                    <ImageView android:layout_height="wrap_content"
                        android:src="@drawable/txt_adlerbock" android:layout_width="wrap_content"></ImageView>
                </LinearLayout>
                <View android:layout_height="130dp" android:layout_width="50dp"></View>
                <LinearLayout android:layout_height="200dp"
                    android:orientation="vertical" android:layout_width="wrap_content"
                    android:gravity="center_vertical" android:layout_marginTop="20px">
                    <ImageView android:layout_height="wrap_content"
                        android:src="@drawable/txt_blahblah" android:layout_width="wrap_content"></ImageView>
                </LinearLayout>
                <View android:layout_height="130dp" android:layout_width="35dp"></View>
                <LinearLayout android:layout_height="200dp"
                    android:orientation="vertical" android:layout_width="wrap_content"
                    android:gravity="center_vertical">
                    <ImageView android:layout_width="wrap_content"
                        android:src="@drawable/image_btl1" android:layout_height="200dp"
                        android:layout_gravity="center_vertical"></ImageView>
                </LinearLayout>
            </LinearLayout>
            <LinearLayout android:id="@+id/image_list_one"
                android:layout_marginLeft="20dp" android:layout_height="200dp"
                android:orientation="horizontal" android:layout_width="800dp"
                android:background="@drawable/search_arrow_left"
                android:layout_weight="0.17">
                <LinearLayout android:layout_height="130dp"
                    android:orientation="vertical" android:layout_width="wrap_content"
                    android:layout_marginTop="70px" android:layout_marginLeft="60px">
                    <ImageView android:layout_height="wrap_content"
                        android:src="@drawable/txt_moosehead" android:layout_width="wrap_content"></ImageView>
                </LinearLayout>
                <View android:layout_height="130dp" android:layout_width="50dp"></View>
                <LinearLayout android:layout_height="200dp"
                    android:orientation="vertical" android:layout_width="wrap_content"
                    android:gravity="center_vertical" android:layout_marginTop="20px">
                    <ImageView android:layout_height="wrap_content"
                        android:src="@drawable/txt_blahblah" android:layout_width="wrap_content"></ImageView>
                </LinearLayout>
                <View android:layout_height="130dp" android:layout_width="35dp"></View>
                <LinearLayout android:layout_height="200dp"
                    android:orientation="vertical" android:layout_width="wrap_content"
                    android:gravity="center_vertical">
                    <ImageView android:layout_width="wrap_content"
                        android:src="@drawable/image_btl2" android:layout_height="200dp"
                        android:layout_gravity="center_vertical"></ImageView>
                </LinearLayout>
            </LinearLayout>
            <LinearLayout android:id="@+id/image_list_one"
                android:layout_marginLeft="20dp" android:layout_height="200dp"
                android:orientation="horizontal" android:layout_width="800dp"
                android:background="@drawable/search_arrow_left"
                android:layout_weight="0.17">
                <LinearLayout android:layout_height="130dp"
                    android:orientation="vertical" android:layout_width="wrap_content"
                    android:layout_marginTop="70px" android:layout_marginLeft="60px">
                    <ImageView android:layout_height="wrap_content"
                        android:src="@drawable/txt_birramorrety" android:layout_width="wrap_content"></ImageView>
                </LinearLayout>
                <View android:layout_height="130dp" android:layout_width="50dp"></View>
                <LinearLayout android:layout_height="200dp"
                    android:orientation="vertical" android:layout_width="wrap_content"
                    android:gravity="center_vertical" android:layout_marginTop="20px">
                    <ImageView android:layout_height="wrap_content"
                        android:src="@drawable/txt_blahblah" android:layout_width="wrap_content"></ImageView>
                </LinearLayout>
                <View android:layout_height="130dp" android:layout_width="35dp"></View>
                <LinearLayout android:layout_height="200dp"
                    android:orientation="vertical" android:layout_width="wrap_content"
                    android:gravity="center_vertical">
                    <ImageView android:layout_width="wrap_content"
                        android:src="@drawable/image_btl2" android:layout_height="200dp"
                        android:layout_gravity="center_vertical"></ImageView>
                </LinearLayout>
            </LinearLayout>
        </LinearLayout>
    </ScrollView>
</LinearLayout>


Either I don't get your question or it should be quite simple; add android:orientation="vertical" to the root LinearLayout, and add an <ImageView/> above the scrollview?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜