Questions tagged [visibility]
Visibility is an attribute of an object. It may refer to the concept of having something visible (or not) on the graphical interface, or a symbol visibility in linkage. This tag should not be used in place of the more specific tags [memory-visibility] or [class-visibility].
visibility
3,194
questions
8698
votes
67
answers
3.2m
views
How do I check if an element is hidden in jQuery?
How do I toggle the visibility of an element using .hide(), .show(), or .toggle()?
How do I test if an element is visible or hidden?
1394
votes
21
answers
759k
views
What is the difference between visibility:hidden and display:none?
The CSS rules visibility:hidden and display:none both result in the element not being visible. Are these synonyms?
560
votes
45
answers
312k
views
How to check visibility of software keyboard in Android?
I need to do a very simple thing - find out if the software keyboard is shown. Is this possible in Android?
399
votes
6
answers
661k
views
Equivalent of jQuery .hide() to set visibility: hidden
In jQuery, there are .hide() and .show() methods which sets the CSS display: none setting.
Is there an equivalent function which would set the visibility: hidden setting?
I know I can use .css() ...
327
votes
4
answers
164k
views
Difference between Visibility.Collapsed and Visibility.Hidden
What are differences between Visibility.Collapsed and Visibility.Hidden in WPF?
192
votes
12
answers
197k
views
DataTrigger where value is NOT null?
I know that I can make a setter that checks to see if a value is NULL and do something. Example:
<TextBlock>
<TextBlock.Style>
<Style>
<Style.Triggers>
<...
171
votes
18
answers
125k
views
How do I invert BooleanToVisibilityConverter?
I'm using a BooleanToVisibilityConverter in WPF to bind the Visibility property of a control to a Boolean. This works fine, but I'd like one of the controls to hide if the boolean is true, and show if ...
162
votes
3
answers
56k
views
What is the difference between the hidden attribute (HTML5) and the display:none rule (CSS)?
HTML5 has a new global attribute, hidden, which can be used to hide content.
<article hidden>
<h2>Article #1</h2>
<p>Lorem ipsum ...</p>
</article>
CSS has ...
147
votes
9
answers
619k
views
How to make a DIV visible and invisible with JavaScript?
Can you do something like
function showDiv()
{
[DIV].visible = true;
//or something
}
142
votes
4
answers
53k
views
Hide/show element with a boolean
I tend to have a lot of these in my code
if(shouldElementBeVisible)
$element.show()
else
$element.hide()
Is there any more elegant way packaged with javascript, jquery, or underscore? ...
135
votes
6
answers
38k
views
Default visibility of class methods in PHP
I looked at the manual, but I can't seem to find the answer.
What is the default visibility in PHP for methods without a visibility declaration? Does PHP have a package visibility like in Java?
...
132
votes
15
answers
139k
views
How do I check if an element is really visible with JavaScript? [duplicate]
In JavaScript, how would you check if an element is actually visible?
I don't just mean checking the visibility and display attributes. I mean, checking that the element is not
visibility: hidden or ...
120
votes
5
answers
40k
views
Package protected alternative in Kotlin
In Java, we have the package protected (default) modifier for classes, which allows us to have many classes in a single package but exposes only a few and keeps the logic encapsulated.
With Kotlin ...
119
votes
8
answers
115k
views
Animate visibility modes, GONE and VISIBLE
So im trying to animate when i set the visibility of a linearlayout with other widgets, from GONE to VISIBLE and the opposite.Im using togglebuttons to show and hide. Here's an image to show what i ...
107
votes
4
answers
74k
views
Private constructor in Kotlin
In Java it's possible to hide a class' main constructor by making it private and then accessing it via a public static method inside that class:
public final class Foo {
/* Public static method */...
99
votes
4
answers
66k
views
Binding Visibility for DataGridColumn in WPF
How can I hide a column in a WPF DataGrid through a Binding?
This is what I did:
<DataGridTextColumn Header="Column header"
Binding="{Binding ColumnValue}"
...
97
votes
13
answers
106k
views
Determine whether UIView is visible to the user?
Is it possible to determine whether my UIView is visible to the user or not?
My View is added as a subview several times into a UITabBarController.
Each instance of this view has an NSTimer that ...
97
votes
3
answers
55k
views
What is DOM reflow?
I was reading about the difference between two CSS properties display:none and visibility:hidden and encountered the DOM reflow term.
The statement was
display: none causes a DOM reflow whereas ...
84
votes
9
answers
26k
views
android View with View.GONE still receives onTouch and onClick
This is confusing me:
As far as I have read, a view with setVisibility(View.GONE); should not receive any more touch- or click events.
My layout has two parts, which will be visible or gone so that ...
84
votes
5
answers
96k
views
Protected and private methods in Rails
Method visibility in Ruby (public, protected, and private methods) has been well explained in places like this blog post. But in Ruby on Rails it seems slightly different than it would be in a regular ...
82
votes
4
answers
62k
views
CSS: Is a hidden object clickable?
If the visibility property of the style of an HTML element is set to hidden, is it still clickable?
When the display property is set to none, the element is not even part of the DOM tree, so that is ...
82
votes
3
answers
11k
views
Why is there no sub-class visibility modifier in Java?
On more than one occasion I have found myself desiring a variable visibility that is not possible in Java. I wanted certain members to be visible within their own class and within any sub-classes, ...
80
votes
13
answers
34k
views
iOS equivalent for Android View.GONE visibility mode
I'm developing an app for iOS and I'm using the Storyboard with AutoLayout ON. One of my view controllers has a set of 4 buttons, and in certain circumstances i would like to make the first one ...
76
votes
5
answers
46k
views
jquery fade element does not show elements styled 'visibility: hidden'
I have a bunch of thumbnails which I am loading with a style of visibility: hidden; so that they all maintain their correct layouts. Once the page is fully loaded I have a jquery function that fades ...
72
votes
4
answers
60k
views
In WPF, how can I determine whether a control is visible to the user?
I'm displaying a very big tree with a lot of items in it. Each of these items shows information to the user through its associated UserControl control, and this information has to be updated every 250 ...
71
votes
4
answers
41k
views
UIView hide children views when out of bounds
I have a view, lets say 100x100. And it has set of uiviews as subviews: let say 30x30
If a subview has top-left coordinate: (90,90) - I expect to see only part of this subview. But I still see entire ...
71
votes
3
answers
38k
views
Is there any way to set a private/protected static property using reflection classes?
I am trying to perform a backup/restore function for static properties of classes. I can get a list of all of the static properties and their values using the reflection objects getStaticProperties() ...
71
votes
2
answers
37k
views
What is the CMake equivalent to "gcc -fvisibility=hidden" when controlling the exported symbol of a shared library?
I developed cross platform software in c++. As I know, Linux .so exported all the symbols by default, well through "gcc -fvisibility=hidden" I can set all the exported symbols as hidden, then set ...
71
votes
5
answers
28k
views
Why does jQuery show/hide use display:none instead of visibility:hidden?
display:none means that the element isn't rendered as part of the DOM, so it's not loaded until the display property changes to something else.
visibility:hidden loads the element, but does not show ...
68
votes
6
answers
29k
views
Why doesn't setVisibility work after a view is animated?
Why doesn't the textView become invisible?
Here is my layout xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:...
65
votes
5
answers
198k
views
How to change visibility of layout programmatically
There is a way to change the visibility of View in the XML, but how can I change programmatically visibility of the layout defined in XML? How to get the layout object?
<LinearLayout
android:id=...
65
votes
9
answers
92k
views
How to wait for element to disappear in cypress? [duplicate]
I have a loading indicator that I need to wait for to disappear before doing my assertions.
I've seen some use the following, but it does not seem to work for me and also I don´t want it to be an ...
62
votes
3
answers
54k
views
How to apply -fvisibility option to symbols in static libraries?
I have a shared library project that is built from 4 static libraries (.a) and one object (.o) file. I am trying to add the -fvisibility=hidden option to restrict symbols in the output to only those ...
58
votes
7
answers
92k
views
jQuery css Visibility with animation
I have few div's placed underneath each other and I'm using css visibility to fade them in and out. The reason why I use visibility is so that the div's don't move place.
For fade In I'm using:
$('....
57
votes
1
answer
160k
views
call javascript function from anchor html tag
I need to display message when the user clicks link
How can I implement something where once the user click the hyper link on Page1, a "processing..." message and then as soon as Page2 is ...
55
votes
2
answers
15k
views
How do i test if something is hidden with jQuery? [duplicate]
Possible Duplicate:
Testing if something is hidden with jQuery
In jQuery, suppose you have an element of some kind that you're hiding and showing, using .hide(), .show() or .toggle(). How do you ...
52
votes
7
answers
55k
views
How to make a real private instance variable?
I want to make an instance variable that can't be accessed from outside. Is something like that possible in objective-c? I remember Apple has private variables and stuff like that, but if people know ...
52
votes
3
answers
6k
views
Why can nested child classes access private members of their parent class, but grandchildren cannot?
Probably similar to the question, Why can outer Java classes access inner class private members? or Access to superclass private fields using the super keyword in a subclass .
But there are some ...
51
votes
9
answers
24k
views
public methods in package-private classes
Does it make a difference to mark methods as public in package-private classes?
class SomePackagePrivateClass
{
void foo(); // package private method
public void bar(); // public ...
47
votes
6
answers
54k
views
Why isn't CSS visibility working?
I added a "spoiler" class in CSS to use for, well, spoilers. Text is normally invisible but appears when the mouse hovers over it to reveal the spoiler to whoever wants to read it.
.spoiler{
...
45
votes
12
answers
16k
views
Why can attributes in Java be public?
As everybody knows, Java follows the paradigms of object orientation, where data encapsulation says, that fields (attributes) of an object should be hidden for the outer world and only accessed via ...
45
votes
6
answers
17k
views
Understanding Java's protected modifier
I have a class called A in package1 and another class called C in package2. Class C extends class A.
A has an instance variable which is declared like this:
protected int protectedInt = 1;
Here is ...
45
votes
1
answer
2k
views
Type-parameterized field of a generic class becomes invisible after upgrading to Java 7
Now Eclipse Indigo SR1 with builtin Java 7 support is finally out since a week or two, I'm migrating my playground projects from Helios SR2 + JDK 1.6_23 to Indigo SR1 + JDK 1.7.0. After a full rebuild ...
44
votes
12
answers
2k
views
Why is the amount of visibility on methods and attributes important?
Why shouldn't one leave all methods and attributes accessible from anywhere (i.e. public)?
Can you give me an example of a problem I can run into if I declared an attribute as public?
43
votes
4
answers
212k
views
Calling the base class constructor from the derived class constructor
I have a question:
Say I have originally these classes which I can't change (let's say because they're taken from a library which I'm using):
class Animal_
{
public:
Animal_();
int getIdA()
...
43
votes
8
answers
15k
views
Reasons to use private instead of protected for fields and methods
This is a rather basic OO question, but one that's been bugging me for some time.
I tend to avoid using the 'private' visibility modifier for my fields and methods in favor of protected.
This is ...
37
votes
12
answers
3k
views
How to change css of tag from an outside link
I have a menu in a tag called sf-menu.
I need the visibility to change to none when the link is clicked and toggled back when clicked again.
Can I achieve this with CSS only or do I need JavaScript?
...
35
votes
7
answers
32k
views
Expose a private Objective-C method or property to subclasses
According to some official talk, a class in Objective-C should only expose public methods and properties in its header:
@interface MyClass : NSObject
@property (nonatomic, strong) MyPublicObject *...
34
votes
6
answers
121k
views
Bind visibility property to a variable
I have a Border with Label inside a Window,
<Border x:Name="Border1" BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="21" Margin="229,164,0,0" VerticalAlignment="Top" ...
34
votes
3
answers
27k
views
toggle visibility of chain group in constraint layout
In previous xml layout, I have multiple view groups with few elements inside. Hide each view group will also hide all of its child elements. Since I wanted to have flat structure and tried ...