xamarin/Xamarin.Forms

[Bug] TitleView behavior inconsistent between Android and iOS

开放

#6,522 创建于 2019年6月13日

 (0 条评论) (0 个反应) (0 位负责人)C# (1,926 个派生)batch import
a/titleviewe/4 :clock4:help wantedinactivep/Androidp/iOS 🍎t/bug :bug:up-for-grabs

仓库指标

星标
 (5,644 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Description

Created a TitleView that contains an image set to Aspect.Fit. The image is resized in Android, but not in iOS. In iOS the image is cut off.

Added padding and margin on the TitleView. Android didn't change, Added a ToolbarItem. The TitleView on Android resized so the full image displayed in the reduced space. On iOS the image is not resized, it is cut off.

Changed the TitleView to add a second image, a label, and a background color. Android did not change at all. iOS did display the changes, at least as many would fit on the screen, as the image was still cut off.

Changed the initial image to add a width request. iOS displayed the image in a smaller size, Android did not

Steps to Reproduce

  1. Run the attached test app on Android and iOS. Android: image

iOS:
image

  1. in TitleView.cs, uncomment the Margin and Padding lines (32 & 33) Android: image iOS: image

  2. In the same file, uncomment the two Background Color lines (14 & 34) Android: image iOS: image

  3. In TargetedMessagePage.xaml.cs, uncomment the ToolbarItems line (23) Android: image iOS: image

  4. In TitleView.CS, comment out the Children declaration with one item (28) and uncomment the one with three (29) Android: image iOS: image

6: In TItleView.cs, uncomment the WidthRequest line (15) Android: image iOS: image

Expected Behavior

The TitleView should properly reflect the changes in both environments.

Actual Behavior

See above

Basic Information

  • Version with issue: 4.1.0 pre2
  • Last known good version:
  • IDE:
  • Platform Target Frameworks:
    • iOS:
    • Android:
    • UWP:
  • Android Support Library Version:
  • Nuget Packages:
  • Affected Devices:

Screenshots

see above

Reproduction Link

HeaderTest.zip

贡献者指南