解决方案:布局就用linearlayout垂直布局好了,宽高match属性,而在代码中,从服务器请求下来的数据,最后一条加上“+添加银行卡字样”,适配器中,最后一条数据找到,添加点击跳转事件,即可完成。
httpUtils.send(HttpRequest.HttpMethod.POST, HttpAddress.HTTP, params, new RequestCallBack<String>() { @Override public void onSuccess(ResponseInfo<String> responseInfo) { list.clear(); list1.clear(); String str = responseInfo.result; Log.i("nbnbnb1025", "str" + str); JSONObject object = null; try { object = new JSONObject(str); String state = object.getString("state"); if (state.equals("1")) { JSONArray message = object.getJSONArray("message"); for (int i = 0; i < message.length(); i++) { String carNumber = message.getJSONObject(i).getString("CarNumber"); list.add(carNumber); } list.add("+ 添加新的银行卡"); list1.addAll(list); adapter.notifyDataSetChanged()其中是适配器中,找到最后一天数据,添加点击事件即可:
class viewholder { public TextView tv_bank_card; } }即可完成点击事件。