클래스 View

 

UI를 구성하는 기본적인 클래스다. 예로 버튼, 텍스트 창 등.

setVisibility(int) 함수를 사용해서 보이게 하거나, 숨길 수 있다. 

 

visible: 보이게 하기

invisible: 안보이게 하지만 영역을 그대로 유지함

gone: 완전하게 숨기, view를 추가하지 않음

 

 

출처>

안드로이드 개발자 사이트

https://developer.android.com/reference/android/view/View

 

 

View

This class represents the basic building block for user interface components. A View occupies a rectangular area on the screen and is responsible for drawing and event handling. View is the base class for widgets, which are used to create interactive UI components (buttons, text fields, etc.). The ViewGroup subclass is the base class for layouts, which are invisible containers that hold other Views (or other ViewGroups) and define their layout properties.

 

Set visibility: You can hide or show views using setVisibility(int).

 

android:visibility

Controls the initial visibility of the view.

Must be one of the following constant values.

ConstantValueDescription

gone 2 Completely hidden, as if the view had not been added.
invisible 1 Not displayed, but taken into account during layout (space is left for it).
visible 0 Visible on screen; the default value.

 

 

 

 

728x90

+ Recent posts