setNavigationBarColor(params: Object)

Requires:
MiniKit≥1.0.0@ray-js/ray≥0.3.23
Platforms:
iOSAndroid
import { setNavigationBarColor } from '@ray-js/ray';

// Promise usage
try {
  const res = await setNavigationBarColor({ ...params });
  console.log(res);
} catch (err) {
  console.log(err.errorMsg);
}

Description

Set the page navigation bar colors

Parameters

PropertyTypeRequiredDescription
frontColorstringYesForeground color value, including the colors of buttons, title, and status bar; only #ffffff and #000000 are supported
backgroundColorstringYesBackground color value; valid values are hexadecimal colors
YesAnimation effect
complete() => voidNoCompletion callback (executed on both success and failure)
success() => voidNoCallback on successful API call
fail(params: Object) => voidNoFailure callback
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

import { setNavigationBarColor } from '@ray-js/ray'

setNavigationBarColor({
  frontColor: "#000000",
  backgroundColor: "#FFFFFF",
  animation: { duration: 300, timingFunc: "easeInOut" },
  success: data => { console.log(data); },
  fail: error => { console.error(error); },
});