草庐IT

inflated_bt

全部标签

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

android - Toast.makeText 给出 "Error inflating class Textview"异常

我的应用程序中的每个Toast.makeText都会给我一个类似于此的堆栈跟踪:/AndroidRuntime:FATALEXCEPTION:mainProcess:com.myapp.application,PID:8843android.view.InflateException:BinaryXMLfileline#27:BinaryXMLfileline#27:ErrorinflatingclassTextViewatandroid.view.LayoutInflater.inflate(LayoutInflater.java:539)atandroid.view.LayoutI

android - 二进制 XML 文件行 # : Error inflating class fragment : Only on Android (6. 0)-Marshmallow

我无法在AndroidM上显示谷歌地图。Hereislayoutxml:AndroidManifestFile:Andinsideapplicationtag:我在运行时请求权限:if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.M&&(checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION)!=PackageManager.PERMISSION_GRANTED||checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCA

android - inflater 是否需要 Activity 的上下文?

我有时会通过Dagger注入(inject)指向LayoutInflater的链接,并从应用程序上下文中在模块中生成它,如下所示:LayoutInflater.from(application);。它减少了代码行。但是大学告诉我这是错误的方法,它必须通过LayoutInflater.from(MainActivity.this);从Activity上下文中给出这是真的吗?布局膨胀器的行为是否取决于上下文类型? 最佳答案 是的,这是真的。考虑到样式有很大的不同。LayoutInflater通过调用它们的构造函数来创建View。它在那里

android - Activity 转换缓慢 : multiple "initializing inflate state" in LogCat

为了在我的ListActivity中提供自定义字体,我根据这个例子写了一个类CustomAdapter扩展BaseAdapterhere.但是,如那里所述,我编写了getView()方法,如下所示:publicViewgetView(intposition,ViewconvertView,ViewGroupparent){StringgameName=gameNames[position];//gameNameisttheString[]oftheCustomAdapterTextViewtv=newTextView(context);tv.setText(gameName);tv.s