由网友(谁没年轻张狂过i)分享简介:我要像下面的GridView之间的图像的一行: I want a line like below image between gridview:随着我都试过了。GridView的XML:GridView XML:我要像下面的GridView之间的图像的一行:
I want a line like below image between gridview:
随着我都试过了。
GridView的XML:
GridView XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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/gridhouseindex"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:listSelector="@null"
android:smoothScrollbar="true"
android:stretchMode="columnWidth"
android:numColumns="2"
android:verticalSpacing="22dp">
</GridView>
适配器XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:id="@+id/imgViewHouseIndex"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal|center"
android:layout_marginLeft="20dp"
android:adjustViewBounds="true"
android:src="@drawable/univer" />
<TextView
android:id="@+id/txtViewHouseIndex"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="TextView"
android:textSize="12sp"
android:textStyle="bold" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@drawable/grid_line" />
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@drawable/grid_line" />
网格线XML:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<stroke
android:width="2dp"
android:color="#b6a9a9" />
<gradient
android:angle="90"
android:endColor="#b6a9a9"
android:startColor="#FFFFFF" />
<corners
android:bottomLeftRadius="1dp"
android:bottomRightRadius="1dp"
android:topLeftRadius="1dp"
android:topRightRadius="1dp" />
通过使用上述code,让我很喜欢下面的图片:
By using the above code, i am getting like following image:
能否有人告诉我,我要去的地方错了或什么,我必须做的,以获得精确的输出。
Can someone please tell me, where i am going wrong or what i have to do to get the exact output.
更新:搜索结果这是我收到的输出。搜索结果
Updated: This is the output i am getting.
推荐答案
有关横向
行: gradientbackground.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:dither="true"
android:shape="rectangle" >
<gradient
android:angle="180"
android:centerColor="#000000"
android:endColor="#F6F6F6"
android:startColor="#F6F6F6" />
</shape>
布局
:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scroll_container"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/white"
android:splitMotionEvents="false" >
<View
android:id="@+id/divider"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:layout_centerVertical="true"
android:background="@drawable/backgrad" />
</RelativeLayout>
有关垂直
行: gradientbackground.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:dither="true"
android:shape="rectangle" >
<gradient
android:angle="270"
android:centerColor="#000000"
android:endColor="#F6F6F6"
android:startColor="#F6F6F6" />
</shape>
布局
:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scroll_container"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/white"
android:splitMotionEvents="false" >
<View
android:id="@+id/divider"
android:layout_width="1dp"
android:layout_height="fill_parent"
android:layout_centerHorizontal="true"
android:background="@drawable/backgrad" />
</RelativeLayout>
我希望这可以帮助你。
I hope this can help you out.
感谢。
相关推荐
最新文章