你的onTouch里面写的mLayout.addView(textView,params);
不是往列表里面添加一条记录吗?
不是往列表里面添加一条记录吗?
解决方案 »
- android中是使用socket和http进行通信,哪种方式更好,更常用?假如数据访问量很大的情况下,应该使用哪种?
- 如何在自定义类中使用图片资源文件?
- 《android SDK 问题》
- 求助:android与pc通讯,android端一直出现“unfortunately,**has stopped”。
- Android 腾讯微博OAuthV1如何关闭应用后再进入不用进行登录
- android sdk 下载太慢了?
- 根据经纬度,找到地址信息(调用android地图百度API)
- juv-rtmp-client 如何去远程服务器的视频在android控件上面播放
- 一个比较蛋疼的问题:layout_width为wrap_content,那么怎样才能使这个view的比例保持不变?
- ANDROID为什么data目录用Linux指令修改权限后还是打不开
- 求一个android游戏开发中UI的框架
- onKeyDown事件中转换键值的问题
简化了界面布局,原理应该是一样的吧,XML如下:<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tabHostLayout"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:id="@+id/tv111"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="双击在右边添加TextView"
/>
<LinearLayout
android:id="@+id/rightView"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:orientation="vertical"
android:layout_toRightOf="@+id/tv111"
>
</LinearLayout>
</RelativeLayout>
textViewLeft = (TextView) findViewById(R.id.tv111);
rightLayout = (LinearLayout) findViewById(R.id.rightView);textViewLeft.setOnTouchListener(this);其他代码没变。