@@ -41,8 +41,15 @@ TSharedRef<SWidget> UImtblBrowserUserWidget::RebuildWidget()
41
41
ScaleBox->AddChild (Browser);
42
42
if (UCanvasPanelSlot* RootWidgetSlot = Cast<UCanvasPanelSlot>(ScaleBox->Slot ))
43
43
{
44
+ #if PLATFORM_ANDROID
45
+ // Android webview needs to be at least 1px to 1px big to work
46
+ // but it can be off screen
47
+ RootWidgetSlot->SetAnchors (FAnchors (0 , 0 , 0 , 0 ));
48
+ RootWidgetSlot->SetOffsets (FMargin (-1 , -1 , 1 , 1 ));
49
+ #else
44
50
RootWidgetSlot->SetAnchors (FAnchors (0 , 0 , 1 , 1 ));
45
51
RootWidgetSlot->SetOffsets (DefaultOffsets);
52
+ #endif
46
53
}
47
54
if (UScaleBoxSlot* ScaleBoxSlot = Cast<UScaleBoxSlot>(Browser->Slot ))
48
55
{
@@ -64,19 +71,25 @@ void UImtblBrowserUserWidget::BeginDestroy()
64
71
65
72
void UImtblBrowserUserWidget::RemoveFromParent ()
66
73
{
74
+ #if !PLATFORM_ANDROID
67
75
// This is all that is needed to persist the widget state outside throughout level/world changes.
68
76
// Super::RemoveFromParent();
69
77
70
78
if (UPanelWidget* CurrentParent = GetParent ())
71
79
{
72
80
CurrentParent->RemoveChild (this );
73
81
}
82
+ #endif
74
83
}
75
84
76
85
77
86
void UImtblBrowserUserWidget::OnWidgetRebuilt ()
78
87
{
88
+ #if PLATFORM_ANDROID
89
+ // Android webview needs to be visible to work
90
+ #else
79
91
SetVisibility (ESlateVisibility::Collapsed);
92
+ #endif
80
93
Super::OnWidgetRebuilt ();
81
94
}
82
95
0 commit comments