更改showcaseview上的文本大小

hc2pp10m  于 2021-07-08  发布在  Java
关注(0)|答案(1)|浏览(361)

我正在我的应用程序中使用案例视图。有没有办法把文字缩小?我不需要迪斯米斯。我想通过点击它的圆圈来关闭它。我该怎么办?

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

h79rfbju1#

添加此样式(例如)并应用于您的showcase

<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>

相关问题