本文整理匯總了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");
}