UI
Retrieve device information, get the capsule button's layout position, and customize the navigation bar appearance.
TTMinis.getDeviceInfo()
Gets device information synchronously.
Returns
Field | Type | Description |
|
| The bottom safe area height. |
Note: In development mode, the SDK may return additional debug fields such as screenWidth, screenHeight, platform, and system.
Example
const deviceInfo = TTMinis.getDeviceInfo();
console.log('deviceInfo:', deviceInfo);TTMinis.getMenuButtonBoundingClientRect()
Gets the layout position of the menu button (the capsule button in the top-right corner). Coordinates are relative to the top-left corner of the screen.
Returns
Field | Type | Description |
|
| Top boundary coordinate, in px. |
|
| Right boundary coordinate, in px. |
|
| Bottom boundary coordinate, in px. |
|
| Left boundary coordinate, in px. |
|
| Width, in px. |
|
| Height, in px. |
Example
const rect = TTMinis.getMenuButtonBoundingClientRect();
console.log('capsule rect:', rect);TTMinis.setNavigationBarColor(options, callback)
Sets the navigation bar color.
Parameters
Field | Type | Description | Required |
|
| The foreground color, such as | Yes |
|
| The background color, such as | Yes |
Callback parameters
Field | Type | Description |
|
| Whether the operation succeeded. |
|
| Returned on failure. |
Example
TTMinis.setNavigationBarColor(
{
frontColor: '#ffffff',
backgroundColor: '#161823',
},
function (res) {
console.log('setNavigationBarColor:', res);
},
);