服务器上只有一张相关图片,显示一个相框。
服务器上有六张相关图片,显示六个相框。问题:
1、这种布局该如何实现,用fragment布局可以实现吗?但是,我在网上搜索了,还是不知道该怎么做。
2、从网络服务器上获取图片和文字,在不知道服务器上有多少张图片时,怎样做才能实现有多少张图片就生成多少个方框。
简单说下实现方法就行,谢谢啦!
解决方案 »
- 怎样使android程序在执行到某个地方自动弹出对话框?
- 求助java Socket传送文件的相关问题
- 请问每个事件处理方法最后的return true/false是什么意思
- 有没有开发android,搭开发环境一步一步操作的教程
- 开发者注意:Android4.0半数应用未适配,格局恐变
- 请大家帮忙看看这个滑动手势代码的问题
- 如何做到在wifi连接建立的时候自动启动一个进程?
- android 初级问题,大虾多多指教
- Android 开发环境 我搭建老失败
- 有熟悉camera录制视频的吗 yuv格式图片的旋转问题
- 需要设计界面,请达人帮忙
- 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不一样,数据的填充不知道如何做。