【问题标题】:Issues with Showcase View on small screen小屏幕上的展示视图问题
【发布时间】:2015-04-29 14:28:25
【问题描述】:

我在我的应用程序中使用了很棒的展示视图库,它非常棒,但不幸的是,小屏幕上的小屏幕上的布局搞砸了,我想这是我的实现中的一个问题,但我不知道如何解决这个问题.

我的一项活动中的代码如下:

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();
        }

【问题讨论】:

    标签: android android-layout showcaseview


    【解决方案1】:

    不幸的是,这不是您的实现的问题,而是库的问题。尝试将所有内容都挤在小屏幕上并不是很聪明。我会记住这个问题,因为我目前正在重写它!

    【讨论】:

    • 我很高兴你在这里添加一个答案......所以我猜现在唯一的解决方案是阻止小屏幕设备下载我的应用程序,至少在你发布新的 livrary 之前
    • 我还有一个大问题..请帮助我:在某些设备上我收到错误 IllegalArgumentException: Layout: -999552
    猜你喜欢
    • 2021-04-06
    • 2016-12-08
    • 1970-01-01
    • 2017-07-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多