2015-04-29 51 views
0

我在我的應用程序中使用了很棒的展示視圖庫,它很棒,但不幸的是佈局在小屏幕上的小屏幕上搞砸了,我想這是我實現時的一個問題,弄清楚如何解決這個問題。陳列櫥問題在小屏幕上查看

example

,並在我的活動之一,它的代碼如下:

if(showcase_flag == 1){ 
      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(); 

           SharedPreferences.Editor editor = prefs.edit(); 
           editor.putInt("showcase_key", 0); 
           editor.commit(); 
          } 

         } 
        }) 
        .doNotBlockTouches() 
        .build(); 

      mViews1.setButtonText("I'm ready"); 
      mViews1.setButtonPosition(lps); 
     }else { 
      updateList(); 
     } 

回答

0

不幸的是,是不是與你的執行的問題,它與庫的問題。試圖在小屏幕上擠壓所有東西並不是很聰明。我現在正在改寫它,所以我會記住這個問題!

+0

我很高興你在這裏添加一個答案...所以即時猜測現在唯一的解決方案是阻止小屏幕設備下載我的應用程序,至少直到你將發佈新的livrary – kitsuneFox

+0

我有另一個專業問題..請幫助我:在一些設備上,我得到了錯誤IllegalArgumentException:佈局:-999552 <0,那是什麼,以及如何解決它? – kitsuneFox