Android Question set all content textcolors black

cambol

Active Member
Licensed User
Longtime User
MY Maimifest , see attach , Just Activity.Title textcolor is black .

How to set all content textcolors black



Code: Copy
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="28"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
AddPermission(android.permission.READ_PHONE_STATE)
'End of default text.
SetApplicationAttribute(android:theme, "@style/LightTheme")
CreateResource(values-v20, theme.xml,
<resources>
  <style
  name="LightTheme" parent="@android:style/Theme.Material.Light">
  </style>
</resources>
)
CreateResource(values-v14, theme.xml,
<resources>
  <style
  name="LightTheme" parent="@android:style/Theme.Holo.Light">
  </style>
</resources>
)
 
Last edited:
1. It is a mistake to set targetSdkVersion to 28. For now you should set it to 26.

2. Assuming that you are using a recent version of B4A then you should set the theme like this:
Code: Copy
CreateResourceFromFile(Macro, Themes.LightTheme)

3. Make sure that all labels and EditText views use the default color for the TextColor. You can delete the color value to switch to the default color.
 
Upvote 0
I have change to below~ BA4 version 8.30

but , default color for the TextColor is not black , still gray .

( the Activity.Title textcolor is black )



Code: Copy
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: http://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
AddPermission(android.permission.READ_PHONE_STATE)
'End of default text.
SetApplicationAttribute(android:theme, "@style/LightTheme")
CreateResourceFromFile(Macro, Themes.LightTheme)
 
Upvote 0
You don't need this line:
Code: Copy
SetApplicationAttribute(android:theme, "@style/LightTheme")

The default color should look "fine" and change based on the set theme. It is possible that the default color will be grey and not black.

See my answer here: https://www.b4x.com/android/forum/t...ole-application-in-android.96308/#post-607642
You can use similar code to change the text color (if you don't want to do it manually with the designer).
 
Upvote 0
Back
Top