Sketchware Docs (Unofficial)
  • Introduction (Under Construction)
  • Official Docs
  • Introduction to Sketchware
    • Adding your app
    • Designing and Programming your app
  • Widgets and Layouts
    • Concept
    • Properties
    • List of Widgets and Layouts
  • Events
  • Blocks
    • Variable
    • List
    • Control
    • Operator
    • Math
    • File
    • View
    • Component
    • More Block
  • Components
    • About Components
    • Intent
    • SharedPreference
    • Calendar
    • Vibrator
    • Timer
    • Dialog
  • Configuration
  • AdMob Guide
  • Community
Powered by GitBook
On this page
  • List of properties
  • Layout Properties
  • Text Properties
  • Image Properties

Was this helpful?

  1. Widgets and Layouts

Properties

Get to the properties by clicking on a widget or layout.

PreviousConceptNextList of Widgets and Layouts

Last updated 4 years ago

Was this helpful?

On this page widgets and layouts will be refired collectively as widgets.

Open the properties of a widget by clicking on that widget:

You can also see a complete list of properties by clicking the widget and clicking see all. There are certain properties that can only be changed in the see all list, for example the enabled property, or the single line property of an edittext.

List of properties

This is unique ID of widget or layout you used. While programming the app, it is needed.

For large apps, make your widget's ID rememberable, since this is how you will be able to find widgets when programming your app. For example, for title, "txt_title", "btn_submit" etc.

Layout Properties

You can set your widget's dimensions. There are few types available.

Type

Explanation

match_parent

The width/height will be matched to the layout it is inside of, in simple words, it will be maximum height/width.

wrap_content

The width/height will be set automatically according to contents in it. It will only take up what the widget needs.

Custom (in dp)

Set custom height/width according to requirement. For example, for small icon, you can use 40x40 (width x height). Keep in mind that if you used a fixed dp, the widget may be cut off in devices with smaller sized screens.

Padding is used to add space inwards of the widget

Padding is added to "Linear Layout"

A padding of 8 dp is applied on Linear Layout

In simple word, gravity is used to set alignment of contents in the widget whereas layout gravity is used to set alignment of the widget.

It can be used to set width of two or more widgets equal by setting both widgets gravity to 1 (or any equal value).

It can be used to fit the widget to screen like this:

Text Properties

Text properties are available only for text containing widgets i.e.:

Title

Explanation

Used to set text of the widget

Used to set text size of the widget

Used to format text in bold, italic or both

Used to set color of text

It is text shown when edittext is empty

Used to set color of hint of edittext

Restrict the widget to use only single line

Restrict the widget to use only specified number of lines

Used to accept only specific type of text

Used to set keyboard's main button

Image Properties

Type

Explanation (Source: abhiandroid.com)

FIT_XY

Fill the image from x and y coordinates of the container

FIT_START

Scale the image from start of the container

FIT_CENTER

Scale the image from center

FIT_END

Scale the image from the end of the container

CENTER

Center the image but doesn’t scale the image

CENTER_CROP

Scale the image uniformly

CENTER_INSIDE

Center the image inside the container, rather than making the edge match exactly

Used to set background color of the widget.

Values

Explanation

ON

Enables the widget, allowing codes and users to manipulate it.

OFF

Disables the widget, hence nobody will have access, even your codes (until you don't enable it back).

It rotates the widget with specific angle you give.

This is rarely used but important property, it moves the widget from its original position. For example, in this image (Pic.8), both widgets have -45 Y translation, which moves them horizontally.

Scale is used to resize widgets; it also resizes the contents in it (in linear layouts and scroll view). It is not used usually in Sketchware because it stretches everything and make the UI worse if not used properly.

Widget ID

Width and height

Padding

Margin

Margin is used to add space outwards of the widget. It is same as but outside of the widget.

Gravity and Layout Gravity

Weight

Weight is very important property, even if it is used rarely. It helps to keep widget stable. It is better that setting a fixed dp, because it will change the widget's size to fit the device it is on. For more information, see . Examples:

Weight Sum

This is one of most unused thing in Sketchware. Nobody has even seen someone using it yet, so there is no information available. You can refer to Stackoverflow if you needed it.

TextView

EditText

Button

CheckBox

Switch

text

text size

text style

text color

hint

hint color

single line

lines

input type

ime option

Image (Only in ImageView)

It set image to the imageview. The Image should be available in .

Scale type (Only in ImageView)

Background Resource

Background resource is used for setting custom background of the widget or layout. You will need to to set background image.

Background Color

Enabled

Rotate

Translation X and Y

scaleX and scaleY

this article
https://stackoverflow.com/a/7452788/9300428
Image Manager
add image in Image Manager
padding
Accessing the see all list
Padding (Pic. 4)
Output (Pic. 5)
Gravity Example (Pic. 6)
Example 1 (Pic. 7)
Example 2 (Pic. 8)
Examples (Pic. 9)
Example (Pic.8)