我在ScrollerView里面写了一个EditText,发现当EditText显示多行的时候,不能上下滚动了。
如果去掉ScrollerView,就能上下滚动了。我觉得ScrollerView把EditText的滚动事件给截取了。
是不是这样?有什么办法解决?谢谢。
如果去掉ScrollerView,就能上下滚动了。我觉得ScrollerView把EditText的滚动事件给截取了。
是不是这样?有什么办法解决?谢谢。
解决方案 »
- 都说用完sqlitedatabase要close,谁能举个资源泄露的例子见识见识?
- 请问怎么动态创建一个layout和SurfaceView,我怎么显示不出来?
- Android模拟器启动时控制台没有信息显示。
- Android设置时间问题
- error: do_inode_allocate_extents: Failed to allocate 749 blocks
- 手机hardware 测试工具
- 默认壁纸的问题
- android dialog转layout
- 在mainactivity中调用另一个xml布局文件的控件问题
- Android蓝牙开发适配问题:部分华为机型连接BLE低功耗蓝牙出现连接失败的情况
- android listview整行选中
- 请求高手帮忙完善游戏手柄效果?
private EditText t;
String s = "北京欢迎你,我家大门常打开,开怀容纳天地1 "+"\n"+
"北京欢迎你,我家大门常打开,开怀容纳天地 2"+"\n"+
"北京欢迎你,我家大门常打开,开怀容纳天地 3"+"\n"+
"北京欢迎你,我家大门常打开,开怀容纳天地 4"+"\n"+
"北京欢迎你,我家大门常打开,开怀容纳天地 5"+"\n"+
"北京欢迎你,我家大门常打开,开怀容纳天地 6"+"\n"+
"北京欢迎你,我家大门常打开,开怀容纳天地 7"+"\n";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.scroll_text);
t = (EditText)findViewById(R.id.sc[code=XML]roll);
t.setText(s);
}
}
[/code]xml:<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ScrollView android:layout_width="fill_parent"
android:layout_height="fill_parent">
<EditText android:id="@+id/scroll"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="18sp"
android:lines="3"/>
</ScrollView>
</LinearLayout>
请帮忙看下。谢谢。
public boolean onInterceptTouchEvent(MotionEvent ev) {
//System.out.println("MyScrollView-->onInterceptTouchEvent");
return false;
}这样就好了。