I have a ScrollView and a block of ads on top of it, which is attached at the bottom of the screen.

The problem is that the block with ads overlaps the last few lines in ScrollView .

Here is a visual example of what is happening:

 .x { position: fixed; top: 12em; width: 19.5em; height: 2em; background: brown; } 
 <h2>scrollview</h2> <textarea cols=40 rows=10> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</textarea> <div class="x"></div> 

I noticed that if you drag the data to the ScrollView when there is nothing left to scroll, it stretches a bit.

Maybe there is an opportunity to increase this stretching in order to get the content out of advertising?

Or tell me another solution, please.

  • xml show. - post_zeew
  • In general, I wonder what kind of behavior you are waiting for when you есть ScrollView и блок рекламы поверх(!) него . - post_zeew
  • post_zeew, I did not expect anything good from this solution. But when the block with advertising has its allocated place, I also do not like it. then on phones with an adblock, the main content because of emptiness on the place where advertising was supposed to be, looks like I indicated its size in pixels and on the final phone it turned out to be less than necessary - John Doe

2 answers 2

You can solve your problem by detecting ad blockers and, if there is a blocker, hide the ad View . But there are two big BUT :

  1. I very much doubt that in the general case it is possible to correctly determine the presence of an ad blocker;
  2. Is it worth it to do it at all? The user who uses the ad blocker must , a priori, be prepared for any consequences of the work of this blocker itself, since it (the ad blocker) affects your application. This is a problem of either the user or the developer of this ad blocker, but not the developer of the application. It does not seem absurd to you if the user asks you: “Listen, man, I blocked advertising in your application with %ADD_BLOCK_APP_NAME% , but now I have just a white background instead of advertising, what should I do?”? Users blocking advertising - SSZB. If you cannot disable advertising in the application, this is another matter. I believe that if you even use banner ads, you must provide the user with the ability to disable them.
  • And what is the "SSZB"? =) - JuriySPb
  • one
    @YuriySPb, Himself angry Pinocchio, echo fidonet. - post_zeew

All you need is to add indent at the bottom of the content to the height of the ad unit.

You can do it through padding of the internal container or through the margin for the last element inside the container or by adding an empty view to the end or placing ScrollView above advertising in one of many ways so that the banner does not overlap the content

  • Bad idea, on the phones with the adblock there is a void. looks like a curve pixel layout - John Doe
  • one
    @JohnDoe, users with an adblock do not pay back the development costs and must suffer) And so your task is practically unsolvable in this case - only if you find a way to find out whether the ad is programmatically blocked and simply reset its height - YuriySPb
  • ie if i use my prog i should suffer?))) - John Doe
  • @JohnDoe, especially for yourself, make an admin panel in the application where there will be a button for zeroing the height of the banner - YuriySPb