Reprezentuje część tarczy zegarka, która zawiera dokładnie 1 układ tekstu .
Wprowadzona w Wear OS 4.
Składnia
<PartText x="integer" y="integer" width="integer" height="integer" pivotX="float" pivotY="float" angle="float-degrees" alpha="integer" name="string" scaleX="float" scaleY="float" renderMode="[SOURCE | MASK | ALL]" tintColor="argb-color | rgb-color"> <!-- Text-specific child elements. --> <Text> <!-- There must be raw text as the leaf inner element within a "PartText" element tree. --> <Font family="font" size="20" color="#00FFFF">Hello world </Font> <Font> <!-- Example of a text decoration element. --> <Outline> <!-- Example of a template with 2 string values. --> <Template>%s %s <Parameter expression="[MONTH_S]" /> <Parameter expression="[DAY]" /> </Template> </Outline> <!-- Example of a text formatting element. --> <Upper> <Template ... /> </Upper> <Template ... /> </Font> </Text> <!-- A "PartText" element can contain this "TextCircular" element instead of a "Text" element. --> <TextCircular centerX="180" centerY="180" direction="COUNTER_CLOCKWISE" endAngle="90" height="340" width="340" startAngle="270"> There must be raw text as the leaf inner element within a "PartText" element tree. <Font family="font" size="20" color="#00FFFF">Hello world </Font> <Font> Example of a text decoration element. <Outline> Example of a template with 2 string values. <Template>%s %s <Parameter expression="[MONTH_S]" /> <Parameter expression="[DAY]" /> </Template> </Outline> Example of a text formatting element. <Upper> <Template ... /> </Upper> <Template ... /> </Font> </TextCircular /> --> <!-- Child elements that are shared across all "Part" elements. --> <Localization .../> <Transform .../> <Variant .../> <Gyro .../> <Launch .../> <ScreenReader .../> </PartText>
Atrybuty
Element PartText
ma te atrybuty:
Atrybuty wymagane
Wymagane są te atrybuty:
x
,y
,width
,height
- Zbiór liczb całkowitych, które określają rozmiar i pozycję elementu.
Atrybuty opcjonalne
Te atrybuty są opcjonalne:
pivotX
,pivotY
- Dwuwymiarowy punkt przestawny, wokół którego obraca się element. Obie wartości to liczby zmiennoprzecinkowe, które są skalowane, by mieściły się w przedziale $ [0, 1] $.
angle
- Liczba stopni, zgodnie z którą element powinien być obrócony wokół i punktu przestawnego.
alpha
- Ustaw poziom przezroczystości, jaki powinien mieć ten element. Wartość
0
wskazuje, że element powinien być całkowicie przezroczysty. Wartość255
wskazuje, że element powinien być całkowicie nieprzezroczysty. name
- Ciąg znaków identyfikujący ten element. Przydatne, jeśli chcesz się do tego odwołać z innego miejsca w pliku tarczy zegarka.
scaleX
- Współczynnik skalowania w poziomie, który ma zostać zastosowany do tego elementu.
scaleY
- Współczynnik skalowania w pionie, który ma zostać zastosowany do tego elementu.
renderMode
- Typ trybu renderowania elementu. Możliwe wartości:
SOURCE
(wartość domyślna),MASK
lubALL
. tintColor
- Zastosuj filtr koloru odcienia do elementu. Musisz określić kolor za pomocą
format ARGB (
#ff000000
= nieprzezroczysta czerń) lub RGB (#000000
= czarny).
Elementy wewnętrzne
Element PartText
może zawierać wymienione poniżej elementy wewnętrzne. Wszystkie elementy
są opcjonalne, ale Text
lub TextCircular
muszą być jednym z
do elementów wewnętrznych. Element PartText
może zawierać nieograniczoną liczbę
elementu wewnętrznego – oprócz Text
, TextCircular
, Localization
, Gyro
,
Launch
i ScreenReader
, które mogą wystąpić maksymalnie 1 raz.
Polecane dla Ciebie
- Uwaga: tekst linku wyświetla się, gdy JavaScript jest wyłączony
- Tekst części
- Grupa
- Obraz części