Creating UI instance using 'XML' like data at runtime

In windows there is a support for generating Xaml strings at runtime for the UI artefact and use it on the main thread for loading the Xaml strings with properties and creating the UI artefact. Below is a code example for it.

    static void createxaml(hstring & str) {
 
        str = LR"(
<Button
        xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation                      
 
                   Name="MyButton"
 
                   Content="Click Me"
 
                   Width="200"
 
                   Height="60"
 
                   HorizontalAlignment="Center"
 
                   VerticalAlignment="Center"
 
                   FontSize="18"
 
                   FontFamily="Segoe UI"
 
                   Foreground="White"
 
                )";
 
}
 
{
   hstring xaml;
    createxaml(xaml);
    Button obj = XamlReader::Load(xaml).as<Button>();
}
 

My question is, Is there similar support available in uikit to create ui instances like UIButton. Is there some native support from apple that allows us to create a button object using an XML like string?

Answered by DTS Engineer in 846303022

If you'd like us to consider adding the necessary functionality, please file an enhancement request using the Feedback Assistant. If you file the request, please post the Feedback number here so we can make sure it gets routed to the right team.

If you're not familiar with how to file enhancement requests, take a look at Bug Reporting: How and Why?

I don't know of any way to create UIKit controls with XML-like strings. In UIKit you can create the UI visually using a storyboard or create the UI in code.

If you'd like us to consider adding the necessary functionality, please file an enhancement request using the Feedback Assistant. If you file the request, please post the Feedback number here so we can make sure it gets routed to the right team.

If you're not familiar with how to file enhancement requests, take a look at Bug Reporting: How and Why?

Creating UI instance using 'XML' like data at runtime
 
 
Q