我正在使用Android Studio 1.0.2,並將DatePicker控件插入到我的活動中。它在運行時看起來工作得很好,但它一直導致預覽中的渲染問題,這使得設計Activity變得很困難。我在這個問題上沒有看到任何帖子,但想知道是否有人遇到過這個問題。我可以發佈的XML,但我不認爲這會有所幫助,因爲它看起來很乾淨。Android日期選取器未在預覽中呈現
謝謝!
這是我得到的消息:
ERROR資源相關
呈現問題
android.content.res.Resources$NotFoundException
at com.android.layoutlib.bridge.android.BridgeContext.obtainStyledAttributes(BridgeContext.java:490)
at com.android.layoutlib.bridge.android.BridgeContext.obtainStyledAttributes(BridgeContext.java:93)
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.04">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Reminder (days ahead): "
android:id="@+id/EditSpecialDay_textDate" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_weight="0.04">
<DatePicker
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/datePicker"
android:layout_gravity="center_horizontal"
android:layout_weight=".04" />
</TableRow>
</LinearLayout>
如這裏要求的堆棧(這是否幫助?)
機器人.content.res.Resources $ NotFoundException at com.android.layoutlib.bridge.android.BridgeContext.obtainStyledAttributes(BridgeContext.java:490) at com.android.layoutlib.bridge.android.BridgeContext.obtainStyledAttributes(BridgeContext.java:93) at android.widget。 TextView.setTextAppearance(TextView.java:2484) at android.widget.YearPickerView $ YearAdapter.getView(YearPickerView.java:132) at android.widget.AbsListView.obtainView(AbsListView.java:2344) at android.widget。 ListView.measureHeightOfChildren(ListView.java:1270) at android.widget.ListView.onMeasure(ListView.java:1182) at android.view.View.measure(View.java:17430) at android.view.ViewGroup。 measureChildWithMargins(ViewGroup.java:5463) at android.widget.Fr ameLayout.onMeasure(FrameLayout.java:430) 在android.view.View.measure(View.java:17430) 在android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5463) 在android.widget.LinearLayout。在android.widget.LineoutLayout.onMeasure(LinearLayout.java:613) 在android.view.View.measure()方法中的measureChildBeforeLayout(LinearLayout.java:1436) (android.widget.LinearLayout.measureVertical(LinearLayout.java:722) View.java:17430) 在android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5463) 在android.widget.FrameLayout.onMeasure(FrameLayout.java:430) 在android.view.View.measure(查看。 java:17430) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.ja VA:5463) 在android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1436) 在android.widget.TableRow.measureChildBeforeLayout(TableRow.java:247) 在android.widget.LinearLayout.measureHorizontal(LinearLayout.java: 1083) 在android.widget.TableRow.onMeasure(TableRow.java:114) 在android.view.View.measure(View.java:17430) 在android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5463) 在android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1436) 在android.widget.LinearLayout.measureVertical(LinearLayout.java:722) 在android.widget.LinearLayout.onMeasure(LinearLayout.java:613) 在android.view.View.measure(View.java:1 7430) 在android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:727) 在android.widget.RelativeLayout.onMeasure(RelativeLayout.java:463) 在android.view.View.measure(查看。的java:17430) 在android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5463) 在android.widget.FrameLayout.onMeasure(FrameLayout.java:430) 在android.view.View.measure(View.java: 17430) 在android.widget.LinearLayout.measureVertical(LinearLayout.java:875) 在android.widget.LinearLayout.onMeasure(LinearLayout.java:613) 在android.view.View.measure(View.java:17430) 在android.widget.LinearLayout.measureVertical(LinearLayout.java:875) 在android.widget.LinearLayout.onMeasure(LinearLayout.java:613) 在android.view.View.measure(View.java:17430) 在com.android.layoutlib.bridge.impl.RenderSessionImpl.measureView(RenderSessionImpl.java:626) at com.android.layoutlib.bridge.impl.RenderSessionImpl.render(RenderSessionImpl.java:526) at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:334) at com.android.ide。 common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350) at com.android.tools.idea.rendering.RenderService $ 5.compute(RenderService.java:688) at com.android.tools.idea.rendering.RenderService $ com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:932) com.android.tools.idea.rendering.RenderService.createRenderSession(RenderService。 java:677) at com.android.tools.idea.rendering.RenderService.render(RenderService.java:815) at org.jetbrains.and roid.uipreview.AndroidLayoutPreviewToolWindowManager.doRender(AndroidLayoutPreviewToolWindowManager.java:646) 在org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.access $ 1700(AndroidLayoutPreviewToolWindowManager.java:82) 在org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager $ 7 $ 1.run (AndroidLayoutPreviewToolWindowManager.java:589) at com.intellij.openapi.progress.impl.ProgressManagerImpl $ 2.run(ProgressManagerImpl.java:178) at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212) at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:171) at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager $ 7.run(AndroidLayoutPreviewToolWindowManager.java:584) at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320) at com.intellij.util .ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310) at com.intellij.util.ui.update.MergingUpdateQueue $ 2.run(MergingUpdateQueue.java:254) at com.intellij.util.ui.update。 MergingUpdateQueue.flush(MergingUpdateQueue.java:269) at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227) at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue。 java:217) at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238) at com.intellij.util.Alarm $ Request $ 1.run(Alarm.java:327) at java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask .run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617) at java .lang.Thread.run(線程。Java的:745)
嗨......一旦清潔和建設項目(對於工作室不知道BT我想它的製作項目選項)和猶若其不工作THN可以請你共享代碼你在XML和所有 – user1140237 2015-02-09 05:57:03
乾淨和建設沒有工作 - 不管怎麼說,我已經這樣做了很多次,而這個問題。我粘貼了最後一點的XML,其中包括日期選擇器 – 2015-02-09 06:03:34
您好我已經檢查過我的AD工作室,它與您的代碼工作正常..渲染也很好..你可以填寫完整的日誌貓你得到什麼? – user1140237 2015-02-09 06:45:02