我正在使用Xamarin.Forms,我在Android上运行2件事时遇到了问题:
我希望页面标题居中,就像在iOS上一样.
MainPage = new NavigationPage(
new LoginPage(){Title = "Center"}) {BarBackgroundColor = Color.Transparent});
Run Code Online (Sandbox Code Playgroud)谁能帮我这个?
android android-layout xamarin.android xamarin xamarin.forms
我想使用带有 Selenium 和 ChromeDriver 的 C# 截取整页屏幕截图。在这里:https : //stackoverflow.com/a/45201692/5400125我找到了一个如何在 Java 中执行此操作的示例。我试图在 C# 中实现这一点,但是在第一次调用 sendEvaluate 时加载页面后出现异常:
OpenQA.Selenium.WebDriverException: '没有这样的会话 (驱动程序信息: chromedriver=2.41.578737 (49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 10.0.17134) x86_6
public class ChromeDriverEx : ChromeDriver
{
public ChromeDriverEx(string chromeDriverDirectory, ChromeOptions options)
: base(chromeDriverDirectory, options, RemoteWebDriver.DefaultCommandTimeout)
{
var addCmd = this.GetType().BaseType
.GetMethod("AddCustomChromeCommand", BindingFlags.NonPublic | BindingFlags.Instance);
addCmd.Invoke(this,
new object[] {"sendCommand", "POST", "/session/:sessionId/chromium/send_command_and_get_result"});
}
public void GetFullScreenshot()
{
Object metrics = sendEvaluate(
@"({" +
"width: Math.max(window.innerWidth,document.body.scrollWidth,document.documentElement.scrollWidth)|0," +
"height: Math.max(window.innerHeight,document.body.scrollHeight,document.documentElement.scrollHeight)|0," +
"deviceScaleFactor: window.devicePixelRatio || 1," +
"mobile: typeof window.orientation …Run Code Online (Sandbox Code Playgroud)