【问题标题】:How to remove button borders inside Nativescript CardView on Android?如何在 Android 上删除 Nativescript CardView 内的按钮边框?
【发布时间】:2016-08-03 19:55:54
【问题描述】:

我在移除 Nativescript-CardView 插件内的按钮上的边框时遇到了一些困难。

html

<CardView #item elevation="50" margin="10">
    <GridLayout rows="auto, auto, auto" columns="*, *, *">
        <Image src="~/images/shop.jpg" stretch="aspectFit" colSpan="3" row="0" ></Image>
        <Button text="&#xE88E;" class="Material btn" row="1" col="0" ></Button>
        <Button text="&#xE8CC;" class="Material btn" row="1" col="1" ></Button>
        <Button text="&#xE530;" class="Material btn" row="1" col="2" ></Button>
     </GridLayout>
</CardView>

css

.btn {
  font-size: 20;
  margin:4;
  border-color: transparent;
  border: 0;
  border-width: 0;
  border-style: none;
  background-color: transparent;
  padding:5px;
}

【问题讨论】:

    标签: nativescript angular2-nativescript


    【解决方案1】:

    好的,所以它与 CardView 无关。只是 Android 5.1 (Lollipop) 上的按钮+ 在你的班级尝试这两个规则,它会起作用。你也不需要border-color: transparent

    border-width: 0.1; background-color: transparent;

    【讨论】:

      【解决方案2】:

      对于当前版本的 NativeScript,0.1-hack 不再起作用。相反,将边框设置为 1 并使其透明或与背景颜色匹配:

      border-width: 1;
      border-color: rgba(0, 0, 0, 0.0);
      background-color: rgba(0, 0, 0, 0.0);
      

      更多信息请看这里:https://github.com/NativeScript/NativeScript/issues/2626#issuecomment-261493611

      【讨论】:

        猜你喜欢
        • 2016-07-24
        • 1970-01-01
        • 2015-06-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-09-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多