【发布时间】:2018-10-31 15:54:13
【问题描述】:
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.setDrawerListener(toggle);
toggle.syncState();
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
ImageView ImageMenuUtama = (ImageView) findViewById(R.id.backgroundDpn);
Picasso.with(this).load( "http://cloudofoasis.com/api/Ivan/Gambar/bkgutama.jpg")
.placeholder(R.drawable.placeholder)
.fit()
.error(R.drawable.error)
.into(ImageMenuUtama);
}
并且这张图片显示了代码错误 占位符(R.drawable.placeholder)和错误(R.drawable.error):
【问题讨论】:
-
您的
placeholder在drawable目录中吗?你确定 -
您遇到了什么错误?显示正确的错误
-
@bardao : 我是新手,你是什么意思?
-
@VicJordan : 看看上面链接中的图片,抱歉英语不好
-
在项目资源管理器中打开
res文件夹并展开所有子文件夹drawable、layout、menu...并检查您的placeholder在哪里。R.drwawable.palceholder表示placeholder在res/drawable目录中。对R.drawable.error做同样的事情
标签: android