#region in axml file for xamarin.android
hello I am trying to make my code in the axml file more readable I have a lot of switches in my program and I want to shrink this part of the code. I read something about it and I found
<!--#region Name-->
My Code
<!--#endregion-->
But it is referred as a normal comment. Could you help me out? I am using Visual Studio 2017 in case it is important to mention.
xamarin.android
add a comment |
hello I am trying to make my code in the axml file more readable I have a lot of switches in my program and I want to shrink this part of the code. I read something about it and I found
<!--#region Name-->
My Code
<!--#endregion-->
But it is referred as a normal comment. Could you help me out? I am using Visual Studio 2017 in case it is important to mention.
xamarin.android
add a comment |
hello I am trying to make my code in the axml file more readable I have a lot of switches in my program and I want to shrink this part of the code. I read something about it and I found
<!--#region Name-->
My Code
<!--#endregion-->
But it is referred as a normal comment. Could you help me out? I am using Visual Studio 2017 in case it is important to mention.
xamarin.android
hello I am trying to make my code in the axml file more readable I have a lot of switches in my program and I want to shrink this part of the code. I read something about it and I found
<!--#region Name-->
My Code
<!--#endregion-->
But it is referred as a normal comment. Could you help me out? I am using Visual Studio 2017 in case it is important to mention.
xamarin.android
xamarin.android
asked Nov 20 '18 at 15:01
Georgi YakovGeorgi Yakov
188
188
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
# region in axml file for xamarin.android
If you want to make the .axml
file more readable, you could click the indent button: Effect.
Or you could use the <include/>
tag embed another layout inside the current layout to make it more readable. For example, create a titlebar.axml
:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/titlebar_bg"
tools:showIn="@layout/activity_main" >
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/gafricalogo" />
</FrameLayout>
Use it in another layout file:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/app_bg"
android:gravity="center_horizontal">
<include layout="@layout/titlebar"/>
<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
android:padding="10dp" />
...
</LinearLayout>
Update:
I think the XAML Regions is what you are looking in your .axml
file.
Update 2:
Install this plugin for your Visual Studio, close all your Visual Studio windows and reopen the VS. Then, you could the the #Region
function for your
<!-- Region (Any Text You Want) -->
Your Code
<!-- EndRegion -->
My point is that I have 32 switches in my code. I find it stupid to click on the button you are talking about for everyone of them. I wanted to specify an area that can be collapsed and hidden when I want so I can hide all of them at once.
– Georgi Yakov
Nov 21 '18 at 9:52
Do you understand what I mean?
– Georgi Yakov
Nov 21 '18 at 9:56
@GeorgiYakov, got it, I have updated my answer, please check it. It works fine on my side.
– York Shen - MSFT
Nov 21 '18 at 10:11
@GeorgiYakov, have you checked my answer?
– York Shen - MSFT
Nov 28 '18 at 9:15
Yeah, I saw it but maybe I'm too stupid and it didn't work :)
– Georgi Yakov
Nov 29 '18 at 13:41
|
show 1 more comment
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53395818%2fregion-in-axml-file-for-xamarin-android%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
# region in axml file for xamarin.android
If you want to make the .axml
file more readable, you could click the indent button: Effect.
Or you could use the <include/>
tag embed another layout inside the current layout to make it more readable. For example, create a titlebar.axml
:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/titlebar_bg"
tools:showIn="@layout/activity_main" >
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/gafricalogo" />
</FrameLayout>
Use it in another layout file:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/app_bg"
android:gravity="center_horizontal">
<include layout="@layout/titlebar"/>
<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
android:padding="10dp" />
...
</LinearLayout>
Update:
I think the XAML Regions is what you are looking in your .axml
file.
Update 2:
Install this plugin for your Visual Studio, close all your Visual Studio windows and reopen the VS. Then, you could the the #Region
function for your
<!-- Region (Any Text You Want) -->
Your Code
<!-- EndRegion -->
My point is that I have 32 switches in my code. I find it stupid to click on the button you are talking about for everyone of them. I wanted to specify an area that can be collapsed and hidden when I want so I can hide all of them at once.
– Georgi Yakov
Nov 21 '18 at 9:52
Do you understand what I mean?
– Georgi Yakov
Nov 21 '18 at 9:56
@GeorgiYakov, got it, I have updated my answer, please check it. It works fine on my side.
– York Shen - MSFT
Nov 21 '18 at 10:11
@GeorgiYakov, have you checked my answer?
– York Shen - MSFT
Nov 28 '18 at 9:15
Yeah, I saw it but maybe I'm too stupid and it didn't work :)
– Georgi Yakov
Nov 29 '18 at 13:41
|
show 1 more comment
# region in axml file for xamarin.android
If you want to make the .axml
file more readable, you could click the indent button: Effect.
Or you could use the <include/>
tag embed another layout inside the current layout to make it more readable. For example, create a titlebar.axml
:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/titlebar_bg"
tools:showIn="@layout/activity_main" >
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/gafricalogo" />
</FrameLayout>
Use it in another layout file:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/app_bg"
android:gravity="center_horizontal">
<include layout="@layout/titlebar"/>
<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
android:padding="10dp" />
...
</LinearLayout>
Update:
I think the XAML Regions is what you are looking in your .axml
file.
Update 2:
Install this plugin for your Visual Studio, close all your Visual Studio windows and reopen the VS. Then, you could the the #Region
function for your
<!-- Region (Any Text You Want) -->
Your Code
<!-- EndRegion -->
My point is that I have 32 switches in my code. I find it stupid to click on the button you are talking about for everyone of them. I wanted to specify an area that can be collapsed and hidden when I want so I can hide all of them at once.
– Georgi Yakov
Nov 21 '18 at 9:52
Do you understand what I mean?
– Georgi Yakov
Nov 21 '18 at 9:56
@GeorgiYakov, got it, I have updated my answer, please check it. It works fine on my side.
– York Shen - MSFT
Nov 21 '18 at 10:11
@GeorgiYakov, have you checked my answer?
– York Shen - MSFT
Nov 28 '18 at 9:15
Yeah, I saw it but maybe I'm too stupid and it didn't work :)
– Georgi Yakov
Nov 29 '18 at 13:41
|
show 1 more comment
# region in axml file for xamarin.android
If you want to make the .axml
file more readable, you could click the indent button: Effect.
Or you could use the <include/>
tag embed another layout inside the current layout to make it more readable. For example, create a titlebar.axml
:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/titlebar_bg"
tools:showIn="@layout/activity_main" >
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/gafricalogo" />
</FrameLayout>
Use it in another layout file:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/app_bg"
android:gravity="center_horizontal">
<include layout="@layout/titlebar"/>
<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
android:padding="10dp" />
...
</LinearLayout>
Update:
I think the XAML Regions is what you are looking in your .axml
file.
Update 2:
Install this plugin for your Visual Studio, close all your Visual Studio windows and reopen the VS. Then, you could the the #Region
function for your
<!-- Region (Any Text You Want) -->
Your Code
<!-- EndRegion -->
# region in axml file for xamarin.android
If you want to make the .axml
file more readable, you could click the indent button: Effect.
Or you could use the <include/>
tag embed another layout inside the current layout to make it more readable. For example, create a titlebar.axml
:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/titlebar_bg"
tools:showIn="@layout/activity_main" >
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/gafricalogo" />
</FrameLayout>
Use it in another layout file:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/app_bg"
android:gravity="center_horizontal">
<include layout="@layout/titlebar"/>
<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
android:padding="10dp" />
...
</LinearLayout>
Update:
I think the XAML Regions is what you are looking in your .axml
file.
Update 2:
Install this plugin for your Visual Studio, close all your Visual Studio windows and reopen the VS. Then, you could the the #Region
function for your
<!-- Region (Any Text You Want) -->
Your Code
<!-- EndRegion -->
edited Nov 29 '18 at 14:25
answered Nov 21 '18 at 2:38
York Shen - MSFTYork Shen - MSFT
6,8611325
6,8611325
My point is that I have 32 switches in my code. I find it stupid to click on the button you are talking about for everyone of them. I wanted to specify an area that can be collapsed and hidden when I want so I can hide all of them at once.
– Georgi Yakov
Nov 21 '18 at 9:52
Do you understand what I mean?
– Georgi Yakov
Nov 21 '18 at 9:56
@GeorgiYakov, got it, I have updated my answer, please check it. It works fine on my side.
– York Shen - MSFT
Nov 21 '18 at 10:11
@GeorgiYakov, have you checked my answer?
– York Shen - MSFT
Nov 28 '18 at 9:15
Yeah, I saw it but maybe I'm too stupid and it didn't work :)
– Georgi Yakov
Nov 29 '18 at 13:41
|
show 1 more comment
My point is that I have 32 switches in my code. I find it stupid to click on the button you are talking about for everyone of them. I wanted to specify an area that can be collapsed and hidden when I want so I can hide all of them at once.
– Georgi Yakov
Nov 21 '18 at 9:52
Do you understand what I mean?
– Georgi Yakov
Nov 21 '18 at 9:56
@GeorgiYakov, got it, I have updated my answer, please check it. It works fine on my side.
– York Shen - MSFT
Nov 21 '18 at 10:11
@GeorgiYakov, have you checked my answer?
– York Shen - MSFT
Nov 28 '18 at 9:15
Yeah, I saw it but maybe I'm too stupid and it didn't work :)
– Georgi Yakov
Nov 29 '18 at 13:41
My point is that I have 32 switches in my code. I find it stupid to click on the button you are talking about for everyone of them. I wanted to specify an area that can be collapsed and hidden when I want so I can hide all of them at once.
– Georgi Yakov
Nov 21 '18 at 9:52
My point is that I have 32 switches in my code. I find it stupid to click on the button you are talking about for everyone of them. I wanted to specify an area that can be collapsed and hidden when I want so I can hide all of them at once.
– Georgi Yakov
Nov 21 '18 at 9:52
Do you understand what I mean?
– Georgi Yakov
Nov 21 '18 at 9:56
Do you understand what I mean?
– Georgi Yakov
Nov 21 '18 at 9:56
@GeorgiYakov, got it, I have updated my answer, please check it. It works fine on my side.
– York Shen - MSFT
Nov 21 '18 at 10:11
@GeorgiYakov, got it, I have updated my answer, please check it. It works fine on my side.
– York Shen - MSFT
Nov 21 '18 at 10:11
@GeorgiYakov, have you checked my answer?
– York Shen - MSFT
Nov 28 '18 at 9:15
@GeorgiYakov, have you checked my answer?
– York Shen - MSFT
Nov 28 '18 at 9:15
Yeah, I saw it but maybe I'm too stupid and it didn't work :)
– Georgi Yakov
Nov 29 '18 at 13:41
Yeah, I saw it but maybe I'm too stupid and it didn't work :)
– Georgi Yakov
Nov 29 '18 at 13:41
|
show 1 more comment
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53395818%2fregion-in-axml-file-for-xamarin-android%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown