如何实现线条的动态移动,一端固定,另一端移动的功能 RadioButton是放到你的layout上面的,你可以通过调用RadioButton的layout(l,t.r.b)来知道它的绘制位置。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Android 获取 布局中组件的坐标 : http://blog.csdn.net/sjf0115/article/details/7306284 你说的太简单了,不明白你不是问“如何设置线条两个端点的位置为两个RadioButton控件的位置”吗。比如说,你的线条两个端点的坐标分别为(x1, y1)和(x2,y2)你的两个RadioButton对象分别为 mRadioButton1, mRadioButton2.把这两个RadioButton分别放到两个坐标点上,比如你的RadioButton的大小为2*SmRadioButton1.layout(x1-S, y1-S, x1+S, y1+S);mRadioButton2.layout(x2-S, y2-S, x2+S, y2+S);这样就把两个RadioButton的的中心点放到(x1, y1) 和 (x2, y2)上了。你试试,不知道你问的是不是这个意思。 你说的太简单了,不明白你不是问“如何设置线条两个端点的位置为两个RadioButton控件的位置”吗。比如说,你的线条两个端点的坐标分别为(x1, y1)和(x2,y2)你的两个RadioButton对象分别为 mRadioButton1, mRadioButton2.把这两个RadioButton分别放到两个坐标点上,比如你的RadioButton的大小为2*SmRadioButton1.layout(x1-S, y1-S, x1+S, y1+S);mRadioButton2.layout(x2-S, y2-S, x2+S, y2+S);这样就把两个RadioButton的的中心点放到(x1, y1) 和 (x2, y2)上了。你试试,不知道你问的是不是这个意思。你弄反了,应该设置线条端点的坐标为按钮的坐标,让端点的坐标随着按钮的坐标变化而变化 新手学习android,求帮助 Android intent 传递对象引用问题 edittext控件问题 关于apk安装的疑问 两个手机怎么通信呢,用Aidl能实现么 解压dex文件出了好多问题 不懂JAVA的菜鸟紧急求助:JAVA如何存储段落? 怎么使用 HTTP GET 和 POST 传递参数 Android bluetooth 不能接收数据 EditText 怎么显示软键盘 读取sd卡根目录下的视频 形成缩略图出错 Android studio下载不了
你不是问“如何设置线条两个端点的位置为两个RadioButton控件的位置”吗。
比如说,你的线条两个端点的坐标分别为(x1, y1)和(x2,y2)你的两个RadioButton对象分别为 mRadioButton1, mRadioButton2.
把这两个RadioButton分别放到两个坐标点上,比如你的RadioButton的大小为2*SmRadioButton1.layout(x1-S, y1-S, x1+S, y1+S);
mRadioButton2.layout(x2-S, y2-S, x2+S, y2+S);这样就把两个RadioButton的的中心点放到(x1, y1) 和 (x2, y2)上了。你试试,不知道你问的是不是这个意思。
你不是问“如何设置线条两个端点的位置为两个RadioButton控件的位置”吗。
比如说,你的线条两个端点的坐标分别为(x1, y1)和(x2,y2)你的两个RadioButton对象分别为 mRadioButton1, mRadioButton2.
把这两个RadioButton分别放到两个坐标点上,比如你的RadioButton的大小为2*SmRadioButton1.layout(x1-S, y1-S, x1+S, y1+S);
mRadioButton2.layout(x2-S, y2-S, x2+S, y2+S);这样就把两个RadioButton的的中心点放到(x1, y1) 和 (x2, y2)上了。你试试,不知道你问的是不是这个意思。
你弄反了,应该设置线条端点的坐标为按钮的坐标,让端点的坐标随着按钮的坐标变化而变化