Screen size for WebView

I don’t know if my question is dumb but I want to create a WebView file that works with different screen types.

myClasse = native.newWebView( display.contentCenterX, display.contentCenterY+25, 1422, 720 )
myClasse:setNativeProperty("setAllowFileAccess", true)
myClasse:request( "ns4.html", system.ResourceDirectory )
 
end

what I don’t understand is that this code works with an amazon fire 7 tablet but when I tried it on another device the image is offset.

here is my config.lua file


application =
{
	content =
	{
		width = 768,
		height = 1024, 
		scale = "letterbox",
		fps = 60,
		
		--[[
		imageSuffix =
		{
			    ["@2x"] = 2,
			    ["@4x"] = 4,
		},
		--]]
	},
}

I don’t remember if I or someone else has pointed this to you yet, but have you read the content scaling guide?

Depending on your content area, you can use a much smaller size for your web view window. Similarly, if you want to make it as large as possible, while always fitting it inside the screen, then you can use display.actualContentWidth and its counterpart to get the device specific screen parameters.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.