badsocal.blogg.se

Kotlin for
Kotlin for







in the individual module adle filesĪpply plugin: 'kotlin-android-extensions'ĪpplicationId "_kotlin" NOTE: Do not place your application dependencies here they belong Top-level build file where you can add configuration options common to all sub-projects/modules.Ĭlasspath ':gradle:3.2.1'Ĭlasspath ":kotlin-gradle-plugin:$kotlin_version" Next dialog, Select Empty Activity and click Next.īadle(Project: TextViewStrikeThroughEx) Select minimum SDK: API 15 – Android 4.0.3 (Ice Cream Sandwich) and click Next. Open Android Studio and start a new Android Studio project.Īpplication name : TextView StrikeThrough Ex. Let’s create a project with the above examples. tPaintFlags(textview.getPaintFlags() & (~ Paint.STRIKE_THRU_TEXT_FLAG)) Textview.paintFlags = textview.paintFlags and Paint.STRIKE_THRU_TEXT_FLAG.inv() Java users, use this ‘~’ symbol with Paint.STRIKE_THRU_TEXT_FLAG. Use inv() method with Paint.STRIKE_THRU_TEXT_FLAG. So let’s create a horizontal line using view and position it above-center of the TextView. RelativeLayout positions its element relative to each other. Using RelativeLayout and View – Android TextView Strikethrough XML example

kotlin for

Put strikethrough_layerlist.xml as TextView’s background value. Just like the above example, put this also as TextView’s background value. We can create a horizontal line using layerlist drawable also. Using LayerList – Android TextView StrikeThrough XML

kotlin for

Put strikethrough_shape.xml as TextView background attribute value. Using Shape drawable, create a horizontal line and put that line middle of your text. Using shape drawable – Android TextView StrikeThrough XML tSpan(new StrikethroughSpan(),4,17, 0) Ĥ. here strikethrough start point: 4, end point: 17 SpannableString spannableString32=new SpannableString("3.2 StrikeThrough Using SpannableString")









Kotlin for