Skip to content

Most visited

Recently visited

navigation
added in version 22.1.0
belongs to Maven artifact com.android.support:support-core-ui:27.0.0

Space

public class Space
extends View

java.lang.Object
   ↳ android.view.View
     ↳ android.support.v4.widget.Space


Space is a lightweight View subclass that may be used to create gaps between components in general purpose layouts.

Summary

Inherited constants

From class android.view.View

Inherited fields

From class android.view.View

Public constructors

Space(Context context, AttributeSet attrs, int defStyle)
Space(Context context, AttributeSet attrs)
Space(Context context)

Public methods

void draw(Canvas canvas)

Draw nothing.

Protected methods

void onMeasure(int widthMeasureSpec, int heightMeasureSpec)

Inherited methods

From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource

Public constructors

Space

added in version 22.1.0
Space (Context context, 
                AttributeSet attrs, 
                int defStyle)

Parameters
context Context

attrs AttributeSet

defStyle int

Space

added in version 22.1.0
Space (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

Space

added in version 22.1.0
Space (Context context)

Parameters
context Context

Public methods

draw

void draw (Canvas canvas)

Draw nothing.

Parameters
canvas Canvas: an unused parameter.

Protected methods

onMeasure

void onMeasure (int widthMeasureSpec, 
                int heightMeasureSpec)

Parameters
widthMeasureSpec int

heightMeasureSpec int

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)