1
左側標籤代碼
XAML
<Label x:Name="presentBtn" Text="선물함" FontSize="16" HorizontalOptions="Start" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Grid.Column="0" BackgroundColor="#A8D2F1">
C#
presentBtn.HeightRequest = 45.0 * (double)App.ScreenWidth/720.0;
presentBtn.WidthRequest = 150.0* (double)App.ScreenWidth/720.0;
。 。 。
右鍵碼
XAML
<Button x:Name="ticketBtn" Text="티켓충전" HorizontalOptions="End" FontSize="16" Clicked="changeTicketCharge" Grid.Column="1" VerticalOptions="CenterAndExpand" BorderRadius="0"/>
C#
ticketBtn.HeightRequest = 45* (double)App.ScreenWidth/720.0;
ticketBtn.WidthRequest = 150* (double)App.ScreenWidth/720.0;
我把按鈕xamarin.form並設置HeightRequest,WidthRequest。 但按鈕大小與設置大小不同。 上面的圖像的兩個按鈕是相同的大小。 左邊是帶背景色的標籤,右邊是按鈕。 但大小不一樣。
我想讓按鈕的大小正確。
我很抱歉,但我對你正在嘗試做的完全喪失。您正在討論標題中的索引,問題中的大小,以及完成時談論如何避免四捨五入。請限制每個帖子的一個問題,並試圖清楚你想要達到的目標,你嘗試過的以及失敗的地方。 –
我編輯問題只設置按鈕大小。抱歉。 –