由於某種原因,我在幾個設備上出現此錯誤,例如:是google nexus 10或lg g3。IllegalArgumentException:佈局:-998896 <0 in showcaseview
這是產生這種錯誤代碼:
mPlusButton.setClickable(false);
guide.setVisibility(View.INVISIBLE);
final RelativeLayout.LayoutParams lps = new RelativeLayout.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
lps.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
lps.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
lps.setMargins(40,0,0,160);
mViews1 = new ShowcaseView.Builder(this)
.setStyle(R.style.CustomShowcaseTheme3)
.setContentTitle("Welcome to listo")
.setContentText("The best way to share your to-do lists\nand manage them in just a few clicks!")
.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(showcase_num == 0){
showcase_num++;
mViews1.setTarget(new ViewTarget(R.id.fab,MainActivity.this));
mViews1.setContentTitle("Manage your lists");
mViews1.setContentText("Press on the plus button to add a new list.\nLong press on a list to exit from it, rename, mute or delete it." +
"\n\nAt both sides of the list's name you can see the number of participants and tasks on it.");
mViews1.setButtonText("Got it!");
}else{
mViews1.hide();
mViews1.destroyDrawingCache();
mPlusButton.setClickable(true);
updateList(false);
SharedPreferences.Editor editor = prefs.edit();
editor.putInt("showcase_key", 0);
editor.commit();
}
}
})
.doNotBlockTouches()
.build();
mViews1.setButtonText("I'm ready");
mViews1.setButtonPosition(lps);
我沒有在互聯網上找到任何解決方案。據我瞭解,由於某些原因,佈局具有導致Layout.java類拋出異常負值...
我有同樣的錯誤。你有沒有找到解決辦法? –
這是SnowcaseView的一個已知問題:https://github.com/amlcurran/ShowcaseView/issues/182。如果沒有幫助,請嘗試提供的解決方案並將代碼添加到此問題。 – birdy