Efekt cienia dla tekstu w Androidzie? [duplikat]
Możliwy duplikat:
Android-cień na SMS?
Jak zrobić tekst efektu cienia w TextView
.
174
3 answers
Być może rozważyłbyś użycie android: shadowColor, android:shadowDx
, android:shadowDy
, android:shadowRadius
; alternatywnie setShadowLayer () ?
184
Author: Pontus Gagge,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-02-26 16:26:13
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-02-26 16:26:13
Umieść je w wartościach / kolorach.xml
<resources>
<color name="light_font">#FBFBFB</color>
<color name="grey_font">#ff9e9e9e</color>
<color name="text_shadow">#7F000000</color>
<color name="text_shadow_white">#FFFFFF</color>
</resources>
Następnie w układzie xml tutaj są przykładowe TextView ' s
Przykład zmiennego tekstu na świetle z ciemnym cieniem
<TextView android:id="@+id/txt_example1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textStyle="bold"
android:textColor="@color/light_font"
android:shadowColor="@color/text_shadow"
android:shadowDx="1"
android:shadowDy="1"
android:shadowRadius="2" />
Przykład tekstu wytrawionego na świetle ciemnym cieniem
<TextView android:id="@+id/txt_example2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textStyle="bold"
android:textColor="@color/light_font"
android:shadowColor="@color/text_shadow"
android:shadowDx="-1"
android:shadowDy="-1"
android:shadowRadius="1" />
Przykład wyraźnego tekstu na jasnym z ciemnym cieniem
<TextView android:id="@+id/txt_example3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textStyle="bold"
android:textColor="@color/grey_font"
android:shadowColor="@color/text_shadow_white"
android:shadowDx="-2"
android:shadowDy="-2"
android:shadowRadius="1" />
Zwróć uwagę na wartości dodatnie i ujemne... Proponuję pobawić się z kolory / wartości samodzielnie, ale ostatecznie możesz dostosować te ustawienia, aby uzyskać efekt, którego szukasz.
324
Author: Codeversed,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-05-17 08:17:09
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-05-17 08:17:09
TextView textv = (TextView) findViewById(R.id.textview1);
textv.setShadowLayer(1, 0, 0, Color.BLACK);
59
Author: DanM,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-02-26 16:22:02
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-02-26 16:22:02