Commit 3f9c4868 authored by Paolo Pecis's avatar Paolo Pecis

Solved iOS difference

parent 461501a2
......@@ -4,9 +4,9 @@
<MonoDevelop.Ide.Workbench ActiveDocument="XAMARINAggregateViews.iOS/Info.plist">
<Files>
<File FileName="XAMARINAggregateViews/MainPage.xaml" Line="4" Column="1" />
<File FileName="XAMARINAggregateViews/MainPage.xaml.cs" Line="99" Column="88" />
<File FileName="XAMARINAggregateViews/MainPage.xaml.cs" Line="115" Column="19" />
<File FileName="XAMARINAggregateViews/IGroupViews.cs" Line="9" Column="6" />
<File FileName="XAMARINAggregateViews.iOS/GroupViewsIOS.cs" Line="34" Column="42" />
<File FileName="XAMARINAggregateViews.iOS/GroupViewsIOS.cs" Line="34" Column="1" />
<File FileName="XAMARINAggregateViews.iOS/Info.plist" />
</Files>
<Pads>
......
......@@ -25,7 +25,7 @@
<key>CFBundleDisplayName</key>
<string>XAMARINAggregateViews</string>
<key>CFBundleIdentifier</key>
<string>com.companyname.XAMARINAggregateViews</string>
<string>com.example.iOSCustomAction1</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>UILaunchStoryboardName</key>
......
......@@ -51,7 +51,7 @@
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<MtouchLink>None</MtouchLink>
<MtouchInterpreter>-all</MtouchInterpreter>
<CodesignProvision>iOS Team Provisioning Profile: com.companyname.XAMARINAggregateViews</CodesignProvision>
<CodesignProvision>iOS Team Provisioning Profile: com.example.iOSCustomAction1</CodesignProvision>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>none</DebugType>
......
......@@ -66,7 +66,10 @@ namespace XAMARINAggregateViews
Padding = 10,
};
//the container that aggregates the views has to be accessible, setting his "AutomationProperties.IsInAccessibleTree" property to true
AutomationProperties.SetIsInAccessibleTree(aggregateElements, true);
if(Device.RuntimePlatform == Device.Android)
{
AutomationProperties.SetIsInAccessibleTree(aggregateElements, true);
}
background.Children.Add(aggregateElements);
//here I create the single views to be aggregated into one single element
......@@ -94,14 +97,31 @@ namespace XAMARINAggregateViews
aggregateElements.Children.Add(agg2);
aggregateElements.Children.Add(agg3);
if (Device.RuntimePlatform == Device.iOS)
{
//groupAccessibleItems(aggregateElements);
}
}
private void groupAccessibleItems(Layout container)
{
String desc = "";
foreach(Label l in container.Children)
{
Console.WriteLine($"PIPPO: id={l.Text}");
AutomationProperties.SetIsInAccessibleTree(l, false);
desc += l.Text;
}
Console.WriteLine($"PIPPO: totaldesc={desc}");
AutomationProperties.SetIsInAccessibleTree(container, true);
AutomationProperties.SetName(container, desc);
}
protected override void OnAppearing()
{
if (Device.RuntimePlatform == Device.iOS)
{
DependencyService.Get<IGroupViews>().aggregateViews(aggregateElements);
groupAccessibleItems(aggregateElements);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment