服务器上只有一张相关图片,显示一个相框。
服务器上有六张相关图片,显示六个相框。问题:
1、这种布局该如何实现,用fragment布局可以实现吗?但是,我在网上搜索了,还是不知道该怎么做。
2、从网络服务器上获取图片和文字,在不知道服务器上有多少张图片时,怎样做才能实现有多少张图片就生成多少个方框。
简单说下实现方法就行,谢谢啦!
解决方案 »
- SIP服务器(Kamailio) 无法使用公网IP
- 向各位大虾取经:希望大家热心推荐一下android游戏开发的资料
- phonegap
- 如果想让自己的网站可以在手机上访问,应该如何入手啊?
- SQlLite一个关键字多个匹配项的查询有问
- android中addLinks的使用
- 找android的工作,希望给点建议
- 关于Android的Ethernet状态广播(android.net.ethernet.ETHERNET_STATE_CHANGED)
- 最近google被屏蔽,搭建android各种问题,好烦~~
- android当内存数据很大的时候,如何能优化内存,提高运行速度
- 需要设计界面,请达人帮忙
- android如何在同一个TextView或者EditText中显示不同大小的字体
GridView
都可以实现,后面的一栏可以当作一行,listview是一行一行设置
gridview是一个一个设置,每3个弄成一行。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content" > <ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="90dp"
android:src="@drawable/table_top" /> <ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="96dp"
android:src="@drawable/table_under" /> <RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp" > <ImageView
android:id="@+id/photo_frame_column_01"
android:layout_width="109dp"
android:layout_height="91dp"
android:src="@drawable/photo_frame" /> <ImageView
android:id="@+id/image_column_01"
android:layout_width="89dp"
android:layout_height="69dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:src="@drawable/none_logo" /> <TextView
android:id="@+id/photo_name_column_01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/photo_frame_column_01"
android:layout_centerHorizontal="true"
android:paddingTop="2dp"
android:text="@string/test"
android:textColor="@color/white" />
</RelativeLayout> <RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="149dp"
android:layout_marginTop="10dp" > <ImageView
android:id="@+id/photo_frame_column_02"
android:layout_width="109dp"
android:layout_height="91dp"
android:src="@drawable/photo_frame" /> <ImageView
android:id="@+id/image_column_02"
android:layout_width="89dp"
android:layout_height="69dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:src="@drawable/none_logo" /> <TextView
android:id="@+id/photo_name_column_02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/photo_frame_column_02"
android:layout_centerHorizontal="true"
android:paddingTop="2dp"
android:text="@string/test"
android:textColor="@color/white" />
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="278dp"
android:layout_marginTop="10dp" > <ImageView
android:id="@+id/photo_frame_column_03"
android:layout_width="109dp"
android:layout_height="91dp"
android:src="@drawable/photo_frame" /> <ImageView
android:id="@+id/image_column_03"
android:layout_width="89dp"
android:layout_height="69dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:src="@drawable/none_logo" /> <TextView
android:id="@+id/photo_name_column_03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/photo_frame_column_03"
android:layout_centerHorizontal="true"
android:paddingTop="2dp"
android:text="@string/test"
android:textColor="@color/white" />
</RelativeLayout>
</RelativeLayout>
这就是一行的数据,但是,不知道如何去填充。我只需要在服务器上获取图片和图片的名称,但是,一行有三列,每列的id不一样,数据的填充不知道如何做。