本文整理汇总了TypeScript中tns-core-modules/file-system/file-name-resolver.FileNameResolver.resolveFileName方法的典型用法代码示例。如果您正苦于以下问题:TypeScript FileNameResolver.resolveFileName方法的具体用法?TypeScript FileNameResolver.resolveFileName怎么用?TypeScript FileNameResolver.resolveFileName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tns-core-modules/file-system/file-name-resolver.FileNameResolver
的用法示例。
在下文中一共展示了FileNameResolver.resolveFileName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: createPage
export function createPage() {
var page = new pages.Page();
var lbl = new label.Label();
var moduleName = "tests/pages/files/test";
var resolver = new fileResolverModule.FileNameResolver({
width: 400,
height: 600,
os: "android",
deviceType: "phone"
});
// Current app full path.
var currentAppPath = fs.knownFolders.currentApp().path;
var moduleNamePath = fs.path.join(currentAppPath, moduleName);
var fileName = resolver.resolveFileName(moduleNamePath, "xml");
lbl.text = fileName;
lbl.textWrap = true;
page.content = lbl;
return page;
}
示例2: test_file_resolver_with_ios_phone_portrait
export function test_file_resolver_with_ios_phone_portrait() {
var fileResolver = new resolver.FileNameResolver(iPhonePortraitContext);
var result = fileResolver.resolveFileName(testFilePath, "xml");
TKUnit.assertEqual(result, testFilePath + ".xml", "File path");
}
示例3: test_file_resolver_with_andorid_tablet_portrait
export function test_file_resolver_with_andorid_tablet_portrait() {
var fileResolver = new resolver.FileNameResolver(androidTabletPortraitContext);
var result = fileResolver.resolveFileName(testFilePath, "xml");
TKUnit.assertEqual(result, testFilePath + ".minWH600.xml", "File path");
}
示例4: test_file_resolver_with_andorid_phone_landscape
export function test_file_resolver_with_andorid_phone_landscape() {
var fileResolver = new resolver.FileNameResolver(androidPhoneLandsacpeContext);
var result = fileResolver.resolveFileName(testFilePath, "xml");
TKUnit.assertEqual(result, testFilePath + ".land.xml", "File path");
}