Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use special symbol (<, >) in layout design in Android

I need two navigation buttons with their texts are < and >. However, the compiler doesn't allow me use those symbols, even if I use \< and \>.

Is there anyway to put these symbol into the XML design file?

like image 745
Luke Vo Avatar asked May 25 '11 13:05

Luke Vo


People also ask

What is the use of layout in Android Studio?

They are used to set the position of child Views within the UI we are building. We can nest the layouts, and therefore we can create arbitrarily complex UIs using a combination of layouts. There is a number of layout classes in the Android SDK.

How do I display special characters in the layout file?

The layout file is an XML file and has certain restrictions on which characters may be used. However, you can use XML escape sequences to display characters which have special meaning to XML. In this case, replace the "Bakeries & Dessert" with the string "Bakeries &amp; Dessert" and you should get the behaviour that you require.

How do I use a suggested layout variant in Android Studio?

Android Studio includes common layout variants that you can use in your project. To use a suggested layout variant, do the following: Open your original layout file, click the Design icon in the top-right corner of the window. Click Orientation for Preview () in the toolbar.

What are the layout classes in the Android SDK?

There is a number of layout classes in the Android SDK. They can be used, modified or can create your own to make the UI for your Views, Fragments and Activities. You can display your contents effectively by using the right combination of layouts. The most commonly used layout classes that are found in Android SDK are:


2 Answers

Use &lt; for <
Use &gt; for >
Use &amp; for &.

etc.

like image 198
Nanne Avatar answered Sep 19 '22 07:09

Nanne


Use &#60; for <

Use &#62; for >

Use &#38; for &

use &#34; for "

for complete List of symbol

use &# decimal code of the symbol ; as above

Enjoy Programming..

like image 35
AMD Avatar answered Sep 20 '22 07:09

AMD