【问题标题】:Change text size on showcaseview更改展示视图上的文本大小
【发布时间】:2020-11-23 08:43:48
【问题描述】:

我在我的应用程序中使用案例视图。 有没有办法让文字变小? 而且我不需要dissmis。 我想通过单击它的圆圈来关闭它。 我该怎么办?

  ShowcaseConfig config =new ShowcaseConfig();
        config.setDelay(500);
        MaterialShowcaseSequence sequence =new MaterialShowcaseSequence(AddSupportActivity.this, SHOWCASE_ID);

        sequence.setConfig(config);

        sequence.addSequenceItem(mEdtDevName,
                "You can enter the identifier of each supporter here There is nothing wrong with not filling in this field", "GOT IT");

        sequence.addSequenceItem(mEdtProName,
                "Each supporter can have a number of projects in a specific time period.Note: A project has only one supporter at a given time period", "GOT IT");

        sequence.start();

或使用此代码:

 new MaterialShowcaseView.Builder(MainActivity.this)
                .setDismissStyle(Typeface.DEFAULT)
                .setTarget(itemDataBase)
                .setContentText("از این قسمت شما میتوانید توسعه دهندگان،پروژه ها و پشتیبانان مورد نظر را اضافه کنید")
                .setDelay(500) // optional but starting animations immediately in onCreate can make them choppy
                .singleUse(SHOWCASE_ID) // provide a unique ID used to ensure it is only shown once
                .show();

【问题讨论】:

    标签: java android showcaseview


    【解决方案1】:

    添加此样式(例如)并应用到您的展示中

    <style name="CustomShowcaseTheme2" parent="ShowcaseView">
            <item name="sv_backgroundColor">#55c2EA</item>
            <item name="sv_showcaseColor">#5d4c9a</item>
            <item name="sv_buttonText">Showcase</item>
            <item name="sv_titleTextAppearance">@style/CustomTitle2</item>
            <item name="sv_detailTextAppearance">@style/CustomText2</item>
        </style>
    
        <style name="CustomTitle2" parent="TextAppearance.ShowcaseView.Title.Light">
            <item name="android:textColor">@color/colorPrimary</item>
            <item name="android:textSize">20sp</item>
    
        </style>
    
        <style name="CustomText2" parent="TextAppearance.ShowcaseView.Detail.Light">
            <item name="android:textColor">#FFFFFF</item>
            <item name="android:textSize">26sp</item>
    
        </style>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-12-25
      • 2011-03-03
      • 2016-07-29
      • 2021-10-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多