Time Text
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
TimeText
là bố cục hiển thị thời gian hiện tại ở đầu màn hình.

Văn bản thời gian (Thời gian ở định dạng văn bản)
Sử dụng văn bản thời gian để hiển thị thời gian cũng như một nhãn không bắt buộc ở đầu màn hình. Khi thiết bị có màn hình tròn, văn bản thời gian sẽ được làm cong.
Khi thiết bị có màn hình hình chữ nhật, dòng chữ thời gian sẽ nằm trên một đường thẳng.
Bạn có thể thêm một nhãn nội dung trên đầu văn bản thời gian. Khi thêm nội dung lên đầu, chiều dài đầy đủ của vòng cung không được lớn hơn một phần tư mặt đồng hồ.
Phân tích
Khi tạo
TimeText
bằng các phần tử có thể cuộn được (chẳng hạn như danh sách), hãy thiết kế
TimeText
mờ dần khi phần tử được cuộn. Sử dụng
Modifier.scrollAway
để cuộn
TimeText
theo chiều dọc và ngoài khung hiển thị, dựa trên trạng thái cuộn.
A. Nội dung trên đầu
B. Dòng phân cách
C. Giờ
Cách sử dụng
Để cho thấy thời gian đến dự kiến trong ứng dụng bản đồ, hãy dùng văn bản thời gian kèm theo nội dung trên đầu như trong ví dụ sau đây.

Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[],null,["# Time text\n\n[`TimeText`](/reference/kotlin/androidx/wear/compose/material/package-summary#TimeText(androidx.compose.ui.Modifier,androidx.wear.compose.material.TimeSource,androidx.compose.ui.text.TextStyle,androidx.compose.foundation.layout.PaddingValues,kotlin.Function0,kotlin.Function1,kotlin.Function0,kotlin.Function1,kotlin.Function0,kotlin.Function1))\nis a layout that shows the current time at the top of the screen.\n\n**Time Text**\n\nUse time text to display the time as well as an optional label on the top\nof the screen. When the device has a round screen time text is curved.\nWhen the device has a rectangular screen, time text is straight.\n\nYou can add an additional leading content label to the time text. When\nadding leading content, the full length of the arc should not be larger\nthan a quarter of the watch face.\n\nAnatomy\n-------\n\nWhen creating `TimeText` with scrollable elements such as lists, design the `TimeText` to fade away when the element scrolls. Use [Modifier.scrollAway](/reference/kotlin/androidx/wear/compose/material/package-summary#(androidx.compose.ui.Modifier).scrollAway(androidx.compose.foundation.ScrollState,androidx.compose.ui.unit.Dp)) to scroll `TimeText` vertically in and out of view, based on the scroll state.\n\n\n**A. Leading content\nB. Separator\nC. Time**\n\nUsage\n-----\n\nTo show the estimated time of arrival in a maps app, use time text with leading\ncontent as shown in the following example."]]