小编Mah*_*oya的帖子

中心对齐水平位置绝对对象

我有一个元素,其位置是绝对的,我面临的唯一问题是我已经应用了一些属性来水平居中对齐,它在mozilla上工作正常,但相同的属性不适用于chrome这里是我的代码

HTML

<a href="#section1" class="scrollTo downarrow"><img src="images/navbar_downarrow.png" class="img-responsive"/></a>
Run Code Online (Sandbox Code Playgroud)

CSS

    .slider{
        position: relative;
        background-image: url("../images/slider.jpg");
        background-size: 100% 100%;
        background-repeat: no-repeat;
    }
    .slider a.downarrow{
        position: absolute;
        margin-left: auto;
        margin-right: auto;
        left: 0;
        right: 0;
        bottom: 20px;
        display: table;
    }
Run Code Online (Sandbox Code Playgroud)

css

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

我总是可以使用lint忽略NewApi而不是不同的styles.xml文件吗?

我有两个styles.xml,一个在values-v21资源文件夹中的另一个值.

values/styles.xml内容是:

<resources>
    <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>
</resources>
Run Code Online (Sandbox Code Playgroud)

values-v21/styles.xml内容是:

<resources>
    <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
        <item name="android:statusBarColor">@android:color/transparent</item>
    </style>
</resources>
Run Code Online (Sandbox Code Playgroud)

我可以从values-v21中删除styles.xml文件,并使用lint工具添加v21dedicated项:ignore ="NewApi"属性,如下所示:

<resources xmlns:tools="http://schemas.android.com/tools">
    <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
        <item name="android:windowDrawsSystemBarBackgrounds" tools:ignore="NewApi">true</item>
        <item name="android:statusBarColor" tools:ignore="NewApi">@android:color/transparent</item>
    </style>
</resources>
Run Code Online (Sandbox Code Playgroud)

我可以毫无问题地这样做吗?

如果我总能这样做,那么拥有两个独立的style.xml文件有什么意义呢?

xml android lint android-layout

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

power shell:如何发送鼠标中键?

如何使用电源shell脚本发送鼠标中键?我想要这样的东西:

Add-Type -AssemblyName System.Windows.Forms
[Windows.Forms.SendKeys]::SendWait('{MButton}')
Run Code Online (Sandbox Code Playgroud)

powershell

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

标签 统计

android ×1

android-layout ×1

css ×1

lint ×1

powershell ×1

xml ×1