Issue
Picture showing what I mean:
I'm using the standard template for Login Activity from Android Studio and trying to edit that, my minSDK is 21, targetSDK is 30 (Emulator is running on API 30).
The problem is that the XML updates the style for the EditText underline, but it does not show it up on the Emulator. In the Emulator is the same black thin line.
I've tried a lot of solutions I've found on stackoverflow and also several links (like https://www.codexpedia.com/android/setting-edittext-underline-color-in-android/) but nothing works.
The background image has an elevation of -20dp, the black line is visible in the Emulator. Also, I've tried putting shapes over it as shown in the previous link or for example this code:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:bottom="1dp"
android:left="-3dp"
android:right="-3dp"
android:top="-3dp">
<shape android:shape="rectangle">
<stroke
android:width="2dp"
android:color="#fff" />
<solid android:color="#00ffffff" />
</shape>
</item>
</layer-list>
But everything works just fine in the XML design panel, while the design is not applied in the Emulator.
Everything else shows up properly in the Emulator. If I edit a string or something, it updates in the Emulator.
Can someone help me, please?
Solution
Please try with SpannableString to underline or colour or hyperlink etc.
Read it from below link https://developer.android.com/reference/android/text/style/UnderlineSpan
Answered By - gpuser
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.