Issue
I have multiple layouts (windows) with an activity for each one of them.
There is this head label with the app name in it usually, but you can change the text in the Activity.cs by putting [Activity(Label = "Any title")]
at the start of the Activity.
My problem is that this label only shows up in the main_activity.xml layout on my mobile device when I am testing the programme, but not in any other new created layouts, even though it shows it as a preview in the XML editor.
Is there a way to make this label show up? It isn't so that the text in the label is just the same color as the label, because my buttons etc. which I put at the top are also when testing directly at the top, there is no gap.
I open the layouts via
Intent intent = new Intent(this, typeof(MyActivity));
StartActivity(intent);
which is in a button click event handler in the previous activity.
Thanks for help!
Solution
When i created a new Activity to load the new layout, the title would not show until i changed the Activity
to AppCompatActivity
.
Change:
public class Activity1 : Activity
{
}
To:
using AndroidX.AppCompat.App;
public class Activity1 : AppCompatActivity
{
}
Answered By - Wendy Zang - MSFT
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.