codecamp

鸿蒙OS 资源文件示例

boolean.json示例

{
    "boolean":[
        {
            "name":"boolean_1",
            "value":true
        },
        {
            "name":"boolean_ref",
            "value":"$boolean:boolean_1"
        }
    ]
}

color.json示例

{
    "color":[
        {
            "name":"red",
            "value":"#ff0000"
        },
        {
            "name":"red_ref",
            "value":"$color:red"
        }
    ]
}

float.json示例

{
    "float":[
        {
            "name":"float_1",
            "value":"30.6"
        },
        {
            "name":"float_ref",
            "value":"$float:float_1"
        },
        {
            "name":"float_px",
            "value":"100px"
        }
    ]
}

intarray.json示例

{
    "intarray":[
        {
            "name":"intarray_1",
            "value":[
                100,
                200,
                "$integer:integer_1"
            ]
        }
    ]
}

integer.json示例

{
    "integer":[
        {
            "name":"integer_1",
            "value":100
        },
        {
            "name":"integer_ref",
            "value":"$integer:integer_1"
        }
    ]
}

pattern.json示例

{
    "pattern":[
        {
            "name":"base",
            "value":[
                {
                    "name":"width",
                    "value":"100vp"
                },
                {
                    "name":"height",
                    "value":"100vp"
                },
                {
                    "name":"size",
                    "value":"25px"
                }
            ]
        },
        {
           "name":"child",
           "parent":"base",
           "value":[
               {
                   "name":"noTitile",
                   "value":"Yes"
               }
           ]
        }
    ]
}

plural.json示例

{
    "plural":[
        {
            "name":"eat_apple",
            "value":[
                {
                    "quantity":"one",
                    "value":"%d apple"
                },
                {
                    "quantity":"other",
                    "value":"%d apples"
                }
            ]
        }
    ]
}

strarray.json示例

{
    "strarray":[
       {
           "name":"size",
           "value":[
               {
                   "value":"small"
               },
               {
                   "value":"$string:hello"
               },
               {
                   "value":"large"
               },
               {
                   "value":"extra large"
               }
            ]
       }
    ]
}

string.json示例

{
    "string":[
        {
            "name":"hello",
            "value":"hello base"
        },
        {
            "name":"app_name",
            "value":"my application"
        },
        {
            "name":"app_name_ref",
            "value":"$string:app_name"
        },
        {
            "name":"app_sys_ref",
            "value":"$ohos:string:request_location_reminder_title"
        }
    ]
}
鸿蒙OS 资源文件分类
鸿蒙OS 应用数据管理
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

鸿蒙OS 开发

鸿蒙OS 术语

鸿蒙OS Java API参考

鸿蒙OS ohos.aafwk.ability

鸿蒙OS ohos.aafwk.abilityjet.activedata

鸿蒙OS ohos.aafwk.content

鸿蒙OS java.lang

鸿蒙OS java.Util

鸿蒙OS java.Util class

鸿蒙OS ohos.data.dataability

鸿蒙OS ohos.data.dataability class

鸿蒙OS ohos.agp.components

鸿蒙OS ohos.agp.components interface

鸿蒙OS ohos.agp.components class

鸿蒙OS ohos.global.configuration

鸿蒙OS java.io

鸿蒙OS ohos.data.resultset

鸿蒙OS ohos.data.resultset interface

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }