0
我在堆棧佈局中有按鈕,但默認情況下它會在子視圖之間添加間距。我如何刪除它?在NativeScript中刪除視圖間的間距
<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>
它失去了連鎖反應。我試圖把'標籤'。它與此解決方案具有相同的結果 –
是的,它肯定會失去連鎖反應,因爲它來自Android中按鈕的默認背景。這在原生Android中也是一個常見問題,因此解決方案是提供自己的連鎖效應。在nativescript中有一個插件,稱爲nativescript-ripple –
它支持nativescript-angular嗎? –