我在stacklayout中有按钮,但默认情况下它会增加子视图之间的间距。我怎么能删除它?
<ScrollView orientation="horizontal" (scroll)="onScroll($event)" id="mainScrollViewButtons" row="0">
<StackLayout id="mainButtonBox" orientation="horizontal">
<Button class="btn btn-primary" margin="0" marginLeft="0" marginRight="0" width="120" text="Blue" (tap)="onBlue()" (swipe)="onSwipe($event)"></Button>
<Button class="btn btn-primary" margin="0" marginLeft="0" marginRight="0" width="120" text="Purple" (tap)="onPurple()" (swipe)="onSwipe($event)"></Button>
<Button class="btn btn-primary" margin="0" width="150" text="Yellow" (tap)="onYellow()" (swipe)="onSwipe($event)"></Button>
<Button class="btn btn-primary" margin="0" width="120" text="Red" (tap)="onYellow()" (swipe)="onSwipe($event)"></Button>
</StackLayout>
</ScrollView>
答案 0 :(得分:0)
您可以使用以下&#34; hack&#34;
你appcss中的
Button {
background-color: rgba(255, 0, 0, 0.0);
border-color:rgba(255, 0, 0, 0.0);
border-width: 1;
}
有关解释按钮边框背后问题的讨论可以找到here