草庐IT

inflation

全部标签

java - 安卓.view.InflateException : Binary XML file line #8: Error inflating class fragment

我正在尝试将布局膨胀为fragment我有#8:错误膨胀类fragment我的View甚至没有创建它落在膨胀如何正确充气布局?我的XML大:我的容器:我的fragment布局:android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"android:padding="10sp">Java主程序:myclassjavafirst:packagecom.project.places;importandroid.app.Activity;import

安卓 KitKat : android. view.InflateException : Error inflating class android. support.design.widget.NavigationView

下面是我的配置。这适用于AndroidLollipop,但在AndroidKitkat上崩溃。我在这里尝试了所有解决方法,但无济于事:Errorinflatingclassandroid.support.design.widget.NavigationView构建.gradleandroid{compileSdkVersion23buildToolsVersion"23.0.2"defaultConfig{minSdkVersion14targetSdkVersion23//SupportRenderScriptLibraryv8renderscriptTargetApi18rende

Android inflate XML 选择器用于 StateListDrawable

是否可以扩展以XML创建的选择器以供StateListDrawable以编程方式使用?我发现StateListDrawable有一个inflate方法,但是我没有找到使用示例。最好避免这样做:StateListDrawablestates=newStateListDrawable();states.addState(newint[]{android.R.attr.state_pressed},getResources().getDrawable(R.drawable.pressed));states.addState(newint[]{android.R.attr.state_focu

android - Inflating RadioGroup in Android-一次检查多个radioButtons

我制作了一个具有可变数量的单选按钮的RadioGroup。问题是可以检查许多单选按钮,它不是在RadioGroup中检查的单个RadioButton(据我所知)我的错误在哪里?这是我的代码:Viewview=inflater.inflate(R.layout.questionnaire_check_question,null);RadioGroupradioGroup=(RadioGroup)view.findViewById(R.id.radioGroup);for(intk=0;kquestionnaire_check_question.xmlcheck_radio_button.

java - inflater.inflate() 方法调用时出现 InflateException

在我的MenuAdapter类中尝试膨胀View时,我不断收到InflateException。我将麻烦的代码包围在try-catchblock中并收到错误消息:整个项目的链接:https://docs.google.com/file/d/0B2Iwl4UysxOMa3E5a1l2SHZwOG8/edit?usp=sharingBinaryXMLfileline#1:Errorinflatingclass代码如下:packagecom.example.sidemenututorial;importandroid.content.Context;importandroid.view.La

java - 安卓.view.InflateException : Binary XML file line #10: Error inflating class fragment

我按照http://www.techotopia.com/index.php/Using_Fragments_in_Android_-_A_Worked_Example上的教程创建了一个应用程序,但我有一个错误。LogCat:05-0208:16:22.044:D/dalvikvm(1846):Late-enablingCheckJNI05-0208:16:22.080:D/AndroidRuntime(1846):ShuttingdownVM05-0208:16:22.080:W/dalvikvm(1846):threadid=1:threadexitingwithuncaughte

android - Inflater inflate 但高度很小(看起来像 wrap_content 需要 fill_parent)

我有布局,我想膨胀它喜欢LinearLayoutll=(LinearLayout)findViewById(R.id.llContainer);Viewview;LayoutInflaterinflater=(LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);view=inflater.inflate(R.layout.question_free_text,null);ll.addView(view);ll在哪里在其他xml中,但问题是当它膨胀时显示但高度很大(fill_parent,它看起来像w

android - 在 LayoutInflater.inflate(resource, root, true) 之后 removeView 不工作

我在自定义View(FrameLayout)中动态添加和删除View:LayoutInflaterinflater=(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);mMyView=inflater.inflate(resId,this,true);稍后我尝试删除View,但View不会删除:removeView(mMyView);如果我这样做,一切都会按预期进行:mMyView=inflater.inflate(resId,this,**false**);addView(mMy

android - Android 应用程序中的布局 inflater 是什么?

这个问题在这里已经有了答案:关闭10年前。PossibleDuplicate:WhatdoesLayoutInflaterinAndroiddo?Android应用中的布局inflater有什么用?

安卓.view.InflateException : Binary XML file line #7: Error inflating class

我在尝试运行我的项目时收到错误消息。我想为Android创建TicTacToe,我使用下面的自定义View来创建TicTacToe棋盘:packageorg.me.TicTacToe.ui;importandroid.content.Context;importandroid.graphics.Canvas;importandroid.graphics.Paint;importandroid.graphics.Paint.Style;importandroid.view.MotionEvent;importandroid.view.View;publicclassTicTacToeBo