求各位大神指点迷津
我写了一个自定义控件,就是在时钟加一个倒影的当我在Manifest.xml里面加了这句时
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true"/>
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8"/>
就会报如下错误:
1-25 10:02:40.907: E/AndroidRuntime(8411): java.lang.StackOverflowError
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.text.TextLine.handleText(TextLine.java:930)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.text.TextLine.handleRun(TextLine.java:1153)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.text.TextLine.measureRun(TextLine.java:589)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.text.TextLine.measure(TextLine.java:453)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.text.TextLine.metrics(TextLine.java:427)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.text.Layout.getLineExtent(Layout.java:943)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.text.Layout.draw(Layout.java:406)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.text.BoringLayout.draw(BoringLayout.java:400)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.widget.TextView.onDraw(TextView.java:5296)
11-25 10:02:40.907: E/AndroidRuntime(8411): at com.alex.bluerabbit.ReflectTextView.onDraw(ReflectTextView.java:37)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.draw(View.java:11038)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.buildDrawingCache(View.java:10755)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.getDrawingCache(View.java:10536)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.getDrawingCache(View.java:10501)
11-25 10:02:40.907: E/AndroidRuntime(8411): at com.alex.bluerabbit.ReflectTextView.onDraw(ReflectTextView.java:41)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.draw(View.java:11038)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.buildDrawingCache(View.java:10755)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.getDrawingCache(View.java:10536)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.getDrawingCache(View.java:10501)
11-25 10:02:40.907: E/AndroidRuntime(8411): at com.alex.bluerabbit.ReflectTextView.onDraw(ReflectTextView.java:41)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.draw(View.java:11038)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.buildDrawingCache(View.java:10755)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.getDrawingCache(View.java:10536)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.getDrawingCache(View.java:10501)
11-25 10:02:40.907: E/AndroidRuntime(8411): at com.alex.bluerabbit.ReflectTextView.onDraw(ReflectTextView.java:41)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.draw(View.java:11038)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.buildDrawingCache(View.java:10755)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.getDrawingCache(View.java:10536)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.getDrawingCache(View.java:10501)
11-25 10:02:40.907: E/AndroidRuntime(8411): at com.alex.bluerabbit.ReflectTextView.onDraw(ReflectTextView.java:41)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.draw(View.java:11038)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.buildDrawingCache(View.java:10755)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.getDrawingCache(View.java:10536)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.getDrawingCache(View.java:10501)
11-25 10:02:40.907: E/AndroidRuntime(8411): at com.alex.bluerabbit.ReflectTextView.onDraw(ReflectTextView.java:41)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.draw(View.java:11038)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.buildDrawingCache(View.java:10755)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.getDrawingCache(View.java:10536)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.getDrawingCache(View.java:10501)
11-25 10:02:40.907: E/AndroidRuntime(8411): at com.alex.bluerabbit.ReflectTextView.onDraw(ReflectTextView.java:41)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.draw(View.java:11038)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.buildDrawingCache(View.java:10755)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.getDrawingCache(View.java:10536)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.getDrawingCache(View.java:10501)
11-25 10:02:40.907: E/AndroidRuntime(8411): at com.alex.bluerabbit.ReflectTextView.onDraw(ReflectTextView.java:41)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.draw(View.java:11038)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.buildDrawingCache(View.java:10755)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.getDrawingCache(View.java:10536)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.getDrawingCache(View.java:10501)
11-25 10:02:40.907: E/AndroidRuntime(8411): at com.alex.bluerabbit.ReflectTextView.onDraw(ReflectTextView.java:41)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.draw(View.java:11038)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.buildDrawingCache(View.java:10755)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.getDrawingCache(View.java:10536)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.getDrawingCache(View.java:10501)
11-25 10:02:40.907: E/AndroidRuntime(8411): at com.alex.bluerabbit.ReflectTextView.onDraw(ReflectTextView.java:41)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.draw(View.java:11038)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.buildDrawingCache(View.java:10755)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.getDrawingCache(View.java:10536)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.getDrawingCache(View.java:10501)
11-25 10:02:40.907: E/AndroidRuntime(8411): at com.alex.bluerabbit.ReflectTextView.onDraw(ReflectTextView.java:41)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.draw(View.java:11038)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.buildDrawingCache(View.java:10755)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.getDrawingCache(View.java:10536)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.getDrawingCache(View.java:10501)
11-25 10:02:40.907: E/AndroidRuntime(8411): at com.alex.bluerabbit.ReflectTextView.onDraw(ReflectTextView.java:41)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.draw(View.java:11038)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.buildDrawingCache(View.java:10755)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.getDrawingCache(View.java:10536)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.getDrawingCache(View.java:10501)
11-25 10:02:40.907: E/AndroidRuntime(8411): at com.alex.bluerabbit.ReflectTextView.onDraw(ReflectTextView.java:41)
11-25 10:02:40.907: E/AndroidRuntime(8411): at android.view.View.draw(View.java:11038)
11-25 10:02:40.907: E/AndroidRuntime(8411): at andr
11-25 10:02:40.988: E/MP-Decision(1261): mpdecision_server(): New Decision parameters Nw=1.990000, Tw=140, Ns=1.100000, Ts=190, DI=50, poll=9, util_h=70, util_l=60
自定义控件我重写了ondraw方法
求大神指点迷津!!!
在线等。 --------------------编程问答-------------------- google --------------------编程问答-------------------- onDraw函數有問題
补充:移动开发 , Android