2 bjht0112357 bjht0112357 于 2014.02.26 19:54 提问

在做viewpager+fragment时遇到的不知道问题在哪啊

异常的log

02-26 19:43:27.231: E/AndroidRuntime(9848): FATAL EXCEPTION: main
02-26 19:43:27.231: E/AndroidRuntime(9848): java.lang.IllegalStateException: Must measure with an exact width
02-26 19:43:27.231: E/AndroidRuntime(9848): at android.support.v4.view.PagerTitleStrip.onMeasure(PagerTitleStrip.java:428)
02-26 19:43:27.231: E/AndroidRuntime(9848): at android.view.View.measure(View.java:12723)
02-26 19:43:27.231: E/AndroidRuntime(9848): at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1416)
02-26 19:43:27.231: E/AndroidRuntime(9848): at android.view.View.measure(View.java:12723)
02-26 19:43:27.231: E/AndroidRuntime(9848): at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:594)
02-26 19:43:27.231: E/AndroidRuntime(9848): at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:376)
02-26 19:43:27.231: E/AndroidRuntime(9848): at android.view.View.measure(View.java:12723)
02-26 19:43:27.231: E/AndroidRuntime(9848): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4698)
02-26 19:43:27.231: E/AndroidRuntime(9848): at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)
02-26 19:43:27.231: E/AndroidRuntime(9848): at android.view.View.measure(View.java:12723)
02-26 19:43:27.231: E/AndroidRuntime(9848): at android.widget.LinearLayout.measureVertical(LinearLayout.java:812)
02-26 19:43:27.231: E/AndroidRuntime(9848): at android.widget.LinearLayout.onMeasure(LinearLayout.java:553)
02-26 19:43:27.231: E/AndroidRuntime(9848): at android.view.View.measure(View.java:12723)
02-26 19:43:27.231: E/AndroidRuntime(9848): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4698)
02-26 19:43:27.231: E/AndroidRuntime(9848): at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)
02-26 19:43:27.231: E/AndroidRuntime(9848): at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2092)
02-26 19:43:27.231: E/AndroidRuntime(9848): at android.view.View.measure(View.java:12723)
02-26 19:43:27.231: E/AndroidRuntime(9848): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1064)
02-26 19:43:27.231: E/AndroidRuntime(9848): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2442)
02-26 19:43:27.231: E/AndroidRuntime(9848): at android.os.Handler.dispatchMessage(Handler.java:99)
02-26 19:43:27.231: E/AndroidRuntime(9848): at android.os.Looper.loop(Looper.java:137)
02-26 19:43:27.231: E/AndroidRuntime(9848): at android.app.ActivityThread.main(ActivityThread.java:4444)
02-26 19:43:27.231: E/AndroidRuntime(9848): at java.lang.reflect.Method.invokeNative(Native Method)
02-26 19:43:27.231: E/AndroidRuntime(9848): at java.lang.reflect.Method.invoke(Method.java:511)
02-26 19:43:27.231: E/AndroidRuntime(9848): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
02-26 19:43:27.231: E/AndroidRuntime(9848): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
02-26 19:43:27.231: E/AndroidRuntime(9848): at dalvik.system.NativeStart.main(Native Method)

2个回答

a1031359915
a1031359915   2014.02.27 15:26

设定下具体的with看下,测试下是由什么引起的

baidu_34727116
baidu_34727116 对改成具体大小就好了
一年多之前 回复
zgt1990
zgt1990   2014.02.28 14:00

方法名称变了,你看下这个帖子http://blog.csdn.net/jw083411/article/details/7913241

Csdn user default icon
上传中...
上传图片
插入图片