Documentation for Nativscript UI

nativescriptrocks

#1

I have just strated building apps in NativeScript. Its very easy to understand all the details provided on the websites.

I am facing issues while creating a new layout with the NativeScript components and attributes. I think as a HTML developer its hard to create layouts in NativScript. First I have to learn all the elements to create a layout and its not easy to understand on the given details.

I dont know which element to use while creating a layout, I saw many examples and have a understanding of basic layout. For example “page” tag and “StackLayout” tag. But still there is lot of tags in NativeScript.

http://docs.nativescript.org/ui/components

In the above link I have read all the components. For example if I need to add paragraph what tag I have to use ?

Is there any breif link about the detailed components and attributes for NativeScript? or any examples for every element how to use it?


#2

In your case for a paragraph for example, you will be using a text view and you will style as desired.
for the second question see this page for full API reference https://docs.nativescript.org/api-reference/globals for example here are all the properties and methods available for text-view https://docs.nativescript.org/api-reference/classes/ui_text_view.textview


#3

Here is the simple way that I have used. You can add paragraphs with the label layout item. Below is code similar to what I have used in my app. Put these inside of a StackLayout or other layout.

You can use CSS to control the text attributes and also use specific inline control. textWrap will get you a paragraph style for lots of text. Along with margin and horizontalAlignment.

   <label class="courseheader" text="Great Course" margin="4" horizontalAlignment="center" />
   <label class="coursedesc" text="Lots and lots of text. Lots and lots of text. Lots and lots of text."margin="20" horizontalAlignment="center" textWrap="true" />

#4

Dear @ganas and @KDS,

Thanks for replying quickly.

I am aware about the api references and read all the detailed info there. What I am looking for is like @KDS share an example of label with multiple attributes. It seems a better way to understand and use every element to create a layout.

Right now Its hard for me to search and read all attributes. because i dont know how to use it. All i am doing is experiments with elements. But its taking to much time to test every element and I’m recreating the layouts.

So is there any examples or sample layouts we have ? Just to understand how elements work to create layouts in XML.

Really appreciate the help! :+1:


#5

They are kind of lacking in that regard. Every time I’m reading the docs I’m like “OK, that’s the code, but where’s a visual example about this?”

Anyway, whatever you don’t find in the docs you can find elsewhere. It’s difficult, but not impossible. It takes some time.

NS Blog: https://www.nativescript.org/blog
NS Snacks: http://www.nativescriptsnacks.com/
Nativescripting (lessons): https://nativescripting.com/
StackOverflow: https://stackoverflow.com/questions/tagged/nativescript
Slack (chat): nativescriptcommunity.slack.com/

And also countless developer blogs, this forum, lessons in sites like Udemy, Platzi, etc.

I’d prefer to have a more concise and complete documentation in a single place, with more (visual) examples and somewhat more up to date. But whatever… if you commit you can get what you need around the web.

Check the resources I mentioned and you may find what you’re looking for.


#6

Totally agree with you @gabitoesmiapodo

But as you said need a complete documentation with more (visual) examples. This will make the process better and fast.

Rest I am trying let see. Its fun!

Thanks for your suggestion will definitely look into above mention links.

:+1: