- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
LOGCAT
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.batyaa.first_gear_automotive, PID: 2582
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.batyaa.first_gear_automotive/com.example.batyaa.first_gear_automotive.HomeActivity}: android.view.InflateException: Binary XML file line #21: Binary XML file line #21: Error inflating class android.support.design.widget.NavigationView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: android.view.InflateException: Binary XML file line #21: Binary XML file line #21: Error inflating class android.support.design.widget.NavigationView
at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.example.batyaa.first_gear_automotive.HomeActivity.onCreate(HomeActivity.java:23)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: android.view.InflateException: Binary XML file line #21: Error inflating class android.support.design.widget.NavigationView
at android.view.LayoutInflater.createView(LayoutInflater.java:645)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.example.batyaa.first_gear_automotive.HomeActivity.onCreate(HomeActivity.java:23)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance(Native Method)
at android.view.LayoutInflater.createView(LayoutInflater.java:619)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.example.batyaa.first_gear_automotive.HomeActivity.onCreate(HomeActivity.java:23)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: android.view.InflateException: Binary XML file line #12: Binary XML file line #12: Error inflating class ImageView
at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.support.design.internal.NavigationMenuPresenter.inflateHeaderView(NavigationMenuPresenter.java:207)
at android.support.design.widget.NavigationView.inflateHeaderView(NavigationView.java:281)
at android.support.design.widget.NavigationView.<init>(NavigationView.java:193)
at android.support.design.widget.NavigationView.<init>(NavigationView.java:104)
at java.lang.reflect.Constructor.newInstance(Native Method)
at android.view.LayoutInflater.createView(LayoutInflater.java:619)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.example.batyaa.first_gear_automotive.HomeActivity.onCreate(HomeActivity.java:23)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: android.view.InflateException: Binary XML file line #12: Error inflating class ImageView
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:782)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.support.design.internal.NavigationMenuPresenter.inflateHeaderView(NavigationMenuPresenter.java:207)
at android.support.design.widget.NavigationView.inflateHeaderView(NavigationView.java:281)
at android.support.design.widget.NavigationView.<init>(NavigationView.java:193)
at android.support.design.widget.NavigationView.<init>(NavigationView.java:104)
at java.lang.reflect.Constructor.newInstance(Native Method)
at android.view.LayoutInflater.createView(LayoutInflater.java:619)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.example.batyaa.first_gear_automotive.HomeActivity.onCreate(HomeActivity.java:23)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: android.content.res.Resources$NotFoundException: Resource "com.example.batyaa.first_gear_automotive:drawable/logo" (7f070103) is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f070103 a=-1 r=0x7f070103}
at android.content.res.Resources.loadDrawableForCookie(Re
Application terminated.
家庭 Activity 私有(private) ActionBarDrawerToggle mToggle;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
Toolbar toolbar = findViewById(R.id.toolbar);
//setSupportActionBar(toolbar);
DrawerLayout drawerLayout = findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawerLayout,toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawerLayout.setDrawerListener(toggle);
toggle.syncState();
NavigationView navigationView = findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
//SECOND MENU
mToggle = new ActionBarDrawerToggle(this, drawerLayout, R.string.navigation_drawer_close, R.string.navigation_drawer_open);
mToggle.syncState();
// getSupportActionBar().setDisplayHomeAsUpEnabled(true);
//******************************* SETTING UP SCROLL BAR *********************************
}
@Override
public void onBackPressed(){
DrawerLayout drawer = findViewById(R.id.drawer_layout);
if(drawer.isDrawerOpen(GravityCompat.START))
{
drawer.closeDrawer(GravityCompat.START);
}
else
{
super.onBackPressed();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
//EXTRA SETTINGS MENU DROP DOWN
getMenuInflater().inflate(R.menu.nav_drawer , menu );
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if(id == R.id.action_settings)
{
return true;
}
if(mToggle.onOptionsItemSelected(item))
{
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {
int id = menuItem.getItemId();
if(id == R.id.inventory)
{
Intent goToInventory = new Intent(HomeActivity.this, InventoryActivity.class);
startActivity(goToInventory);
Toast.makeText(getApplicationContext(),"Welcome To Car Inventory", Toast.LENGTH_SHORT).show();
}
else if(id == R.id.home)
{
Intent goToLocation = new Intent(this, HomeActivity.class);
startActivity(goToLocation);
Toast.makeText(getApplicationContext(),"Welcome To HOME", Toast.LENGTH_SHORT).show();
}
else if(id == R.id.location)
{
Intent goToLocation = new Intent(HomeActivity.this, LocationActivity.class);
startActivity(goToLocation);
Toast.makeText(getApplicationContext(),"Welcome To Store Location", Toast.LENGTH_SHORT).show();
}
else if(id == R.id.office_hours)
{
Intent goToOfficeHours = new Intent(HomeActivity.this, Office_Hours_Activity.class);
startActivity(goToOfficeHours);
Toast.makeText(getApplicationContext(),"Welcome To Our Office Hours", Toast.LENGTH_SHORT).show();
}
else if(id == R.id.warranty)
{
Intent goToWarranty = new Intent(HomeActivity.this, Warranty_Activity.class);
startActivity(goToWarranty);
Toast.makeText(getApplicationContext(),"Welcome To Our Car Warranty", Toast.LENGTH_SHORT).show();
}
else if (id == R.id.feedback)
{
Intent goToFeedback = new Intent(HomeActivity.this, Feedback_Activity.class);
startActivity(goToFeedback);
Toast.makeText(getApplicationContext(),"Welcome To Car Feedback", Toast.LENGTH_SHORT).show();
}
DrawerLayout drawer = findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;
}
最佳答案
错误信息包括
Caused by: android.view.InflateException:
Binary XML file line #12: Error inflating class ImageView at
...
android.support.design.internal.NavigationMenuPresenter.inflateHeaderView(
NavigationMenuPresenter.java:207)
...
Caused by: android.content.res.Resources$NotFoundException:
Resource "com.example.batyaa.first_gear_automotive:drawable/logo" (7f070103
is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f070103 a=-1 r=0x7f070103}
您设置为 NavigationView
标题的布局中包含的 @drawable/logo
不是有效的 drawable。
关于android - 如何修复此错误?膨胀类 android.support.design.widget.NavigationView 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52582816/
我正在用power designer创建一个物理模型,我想将默认值添加到我的Mysql表中。 有可能吗,有人加了默认值 ? 谢谢 最佳答案 有可能,我发现“列属性”并不容易 方法如下: 选择表格(单击
关闭。这个问题是 opinion-based 。它目前不接受答案。 想改善这个问题吗?更新问题,以便可以通过 editing this post 用事实和引文来回答。 2年前关闭。 Improve t
我正在编写一个采用 Material Design 布局的应用程序,但找不到任何关于如何将对话框动画显示到屏幕上的指南。 这表明盒子应该只是“砰”的一声存在,但这似乎违背了设计的精神,包括动画和触觉。
我做了一个巨大的掠夺,不小心丢失了我的*.cs(设计文件)..我刚刚得到了*.designer文件。 我能否反过来,仅使用 .designer 文件以某种方式创 build 计文件 (*.cs),还是
如果 Google 的关键字规划器向我显示关键字“Web Design [city-name]”获得约 880 次搜索,而“Website Design [city-name]”获得约 620 次搜索
首先,代码: $(document).ready(function() { $('#member_pattern').hide(); $('.add-member').click(function()
大型软件公司之一问了这个问题。我想出了一个简单的解决方案,我想知道其他人对该解决方案有何看法。 You are supposed to design an API and a backend for
在最新的 Material Design 文档 (https://www.google.com/design/spec/what-is-material/elevation-shadows.html#
背景 我正在对从我们的 RDBMS 数据库到 MongoDB 的转换进行原型(prototype)设计。在进行非规范化时,似乎我有两种选择,一种会导致许多(数百万)个小文档,另一种会导致更少(数十万)
Qt Designer (5.11.2) 在选择 QWebEngineView-Widget 时崩溃。 我正在创建一个对话框,以将其作为 .ui 文件包含在 QGIS 3 中。在表单中,我想使用 QW
我直接从 getmdl.io(组件页面)和所有设备(多台 PC、浏览器、手机等)复制代码,汉堡菜单不在标题中居中。我似乎无法隔离 css 中的菜单图标来重新对齐它。 getmdl.io 上的所有组件代
如何为 SPA 动态初始化 materialize design lite (google) 的组件?当我在 View 中动态初始化组件时,JS 没有初始化。正如我已经尝试过使用 componentH
我正在使用 Angular 4 构建一个 Web 应用程序。对于设计,我使用的是 Material Design lite。但是,我想使用 MDL 实现一个交互式轮播,它给我流畅的外观和感觉,并且与我
它看起来像 Polymer Starter Kit包含比 Material Design Lite 更多的组件,并且现在可用。由于两者都是符合 Material Design 理念的 Google 项
我在设置 mdl-textfield 样式时遇到了一些困难。 具体来说,设置 float 标签的大小和颜色,以及按下输入字段后动画的高度和颜色。 实际上,这是我从组件列表中获取的起点。 https:/
所以,好友列表的现代概念: 假设我们有一个名为 Person 的表。现在,那个 Person 需要有很多伙伴(其中每个伙伴也在 person 类中)。构建关系的最明显方法是通过连接表。即 buddyI
如何在导航中创建子菜单项? Link Link Link Link 我不能用 用它。什么是正确的类? 最佳答案 MDL 似乎还没有原生支持子菜单。 然而
我想知道我应该遵循哪些步骤来解决设计自动售货机等问题并提出许多设计文档(如用例、序列图、类图)。是否有任何我可以阅读的来源/链接,其中讨论了如何逐步进行。 谢谢。 最佳答案 我不确定是否有任何普遍接受
早在 10 月份,Kristopher Johnson 就询问了 Accounting Software Design Patterns 他收到了几个答案,但基本上都是一样的,都指向Martin Fo
我一直在为我们的产品开发一些组件,其中之一是基于流布局面板。 我想做的是为它提供一个自定义设计器,但不会丢失其默认设计器 (System.Windows.Forms.Design.FlowLayout
我是一名优秀的程序员,十分优秀!