小编Rob*_*ers的帖子

Safari浏览器的预取解决方案?

根据此链接预取,预取仅适用于特定浏览器.不幸的是,我需要它主要在移动设备上工作.

任何人都有一个解决方案如何预加载,预取,缓存页面,以便它适用于iOS?(苹果浏览器)

html safari prefetch

6
推荐指数
1
解决办法
997
查看次数

对齐按钮内的文本和图像

所以我需要创建一个 LIKE 按钮。但我不能让我的文本和图像按中间中心对齐。+这个 % 的响应性让我发疯。

也许我做的事情太难了,有人可以更轻松地重写并向我解释。但我希望按钮以 % 的响应进行缩放。

这就是我要的
在此处输入图片说明
这就是我目前所拥有的
在此处输入图片说明

    .kom_augsha .treshais{
    	width:15%;
    	float:right;
    }
    
    .reitings{
      display:table;
      width: 100%;
      border: 1px solid #e9e9e9;
      
    }
    
    .rate {
      display: table-cell;
      text-align: center;
      vertical-align:middle;
      line-height: 1.5em;
    }
    
    .plus {
      background: white;
      color: green;
    }
    
    .minus{
      background: white;
      color: red;
      border-left: 1px solid #e9e9e9;
      padding-left:10px;
      text-align:center;
    }
Run Code Online (Sandbox Code Playgroud)
<div class="treshais">
  <div class="reitings">
    <div class="rate plus"><img src="plus.jpg"/>83</div>
    <div class="rate minus"><img src="minus.jpg"/>9</div>
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

html css

4
推荐指数
1
解决办法
4673
查看次数

是否可以创建打开/关闭表单的自定义方法?

所以我有这三个按钮点击.

private void btn_OpenNotePad_Click(object sender, EventArgs e)
{
    this.Hide();

    Form2 forma_NotePad = new Form2();
    forma_NotePad.ShowDialog();

    this.Close();
}

private void btn_OpenPaint_Click(object sender, EventArgs e)
{
    this.Hide();

    Form3 forma_Paint = new Form3();
    forma_Paint.ShowDialog();

    this.Close();
}

private void btn_ContactAdmin_Click(object sender, EventArgs e)
{
    this.Hide();

    Form4 forma_ContactAdmin = new Form4();
    forma_ContactAdmin.ShowDialog();

    this.Close();
}
Run Code Online (Sandbox Code Playgroud)

它们都非常相似,所以我想到可以为它们创建一种方法吗?就像是:

private void OpenForm(parameter1, parameter2)
{
    this.Hide();

    parameter1 parameter2 = new parameter1();
    parameter2.ShowDialog();

            this.Close();
}
Run Code Online (Sandbox Code Playgroud)

所以我可以打电话给他们

OpenForm(parameter1,parameter2);
Run Code Online (Sandbox Code Playgroud)

并使我的代码更短,更清洁.

c# winforms

3
推荐指数
1
解决办法
36
查看次数

矩形下的CSS三角形

在此输入图像描述

这就是我想要的.目前我只有一个里面有文字的矩形.不知道如何在它下面创建这个矩形.

码:

.txt_First {
    font-size:0.8em;
    text-align: justify;
    padding-bottom:20px;
}
.com_box {
    width:60px;
    height: 50px;
    background: black;
    color:white;
    float:left;
    display: flex;
    justify-content: center; /* align horizontal */
    align-items: center; /* align vertical */
    margin-right:8px;
    margin-bottom: 5px;
    margin-top:1px;
}
Run Code Online (Sandbox Code Playgroud)

HTML:

<div class="com_box">71</div>
      <div class="txt_First">
      Lorem Ipsum is simply dummy text of the printing and typesetting    industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to …
Run Code Online (Sandbox Code Playgroud)

html css

2
推荐指数
1
解决办法
919
查看次数

Java中的Chromedriver不可执行

所以我试图学习Selenium并遇到问题.无法运行chromedriver.

错误:

Exception in thread "main" java.lang.IllegalStateException: The driver is not executable: /Users/Roberto/Documents/EclipseProjects/MansPirmaisSelenium/lib/chromedriver
Run Code Online (Sandbox Code Playgroud)

码:

System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir")+"//lib//chromedriver");
WebDriver chromeDriver = new ChromeDriver();
chromeDriver.get("http://www.google.lv");
Run Code Online (Sandbox Code Playgroud)

我想我的chromedriver在正确的道路上,这是图像. 在此输入图像描述

java selenium-chromedriver selenium-webdriver

2
推荐指数
1
解决办法
7982
查看次数

如何从方法中调用'绘制圆'来绘制内部图片框

我不知道该怎样传递给我的方法来正确调用我的Circle绘图.这是我的代码:

    private void Circle()
    {
        Graphics g1 = e.Graphics;
        Pen p1 = new Pen(Color.Black);
        g1.DrawEllipse(p1, 12, 12, 50, 50);
    }

    private void pictureBox1_Paint(object sender, PaintEventArgs e)
    {
        Circle();
    }
Run Code Online (Sandbox Code Playgroud)

这不起作用,因为没有'e'.

如果我重写我的代码

Graphics g1 = e.Graphics;
Run Code Online (Sandbox Code Playgroud)

Graphics g1 = this.CreateGraphics();
Run Code Online (Sandbox Code Playgroud)

它会绘制圆圈但不会在图片框中绘制.我需要一个圆圈才能进入图片框.

c# winforms

1
推荐指数
1
解决办法
411
查看次数

方法不适用于我的tic tac toe游戏

如果我传递此代码,那么它的工作原理.

if (textBox1.Text == "1:1" && xOneOne == false && oOneOne == false)
{
    oOneOne = true;
    xOneOne = false;
    pictureBox1.Refresh();
}
else
{
    MessageBox.Show("Lauks ir aiznjemts xDDDD");
}
Run Code Online (Sandbox Code Playgroud)

但我想创建Method,所以我不需要一遍又一遍地复制相同的代码.该方法无效.我想它不会刷新图片框,因为我没有得到图像.

我的方法:

private void Aplis(TextBox textBox, string koordinatas, bool xVertiba, bool oVertiba, PictureBox PictureBox)
{
    if (textBox.Text == koordinatas && xVertiba == false && oVertiba == false)
    {
        oVertiba = true;
        xVertiba = false;
        PictureBox.Refresh();
    }
    else
    {
        MessageBox.Show("Lauks ir aiznjemts xDDDD");
    }
}
Run Code Online (Sandbox Code Playgroud)

我尝试这样称呼它而不是我的第一个代码:

Aplis(textBox1, "1:1", xOneOne, oOneOne, pictureBox1);
Run Code Online (Sandbox Code Playgroud)

c# winforms

0
推荐指数
1
解决办法
54
查看次数