Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid cutting my text when using fragments
    primarykey
    data
    text
    <p>I have an activity with one fragment. On top of the fragment, I want to place and small advertisement. The problem is, if I define anything on top of my fragment, the text inside my frag will appear cutted. Look at the images (before showing the advertisement and after).</p> <p>Before: <img src="https://i.stack.imgur.com/7lAL3.png" alt="Normal image"> After: <img src="https://i.stack.imgur.com/al0wG.png" alt="Problematic image"> Note the scrollbar, it's on the top, which means it's cutting the visibility of my button.</p> <p>All I wanted was to keep the text 'Jogar' visible when the advertisement is visible. Here is some of the xml and code to help, if necessary. Please, help me if you have any idea how to fix it.</p> <p>activity_xml:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#00F"&gt; &lt;com.google.ads.AdView android:id="@+id/adView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" ads:adUnitId="..." ads:adSize="BANNER" ads:testDevices="TEST_EMULATOR" android:background="@android:color/transparent" ads:loadAdOnCreate="true" /&gt; &lt;FrameLayout android:id="@+id/fragmentPlaceholder" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#0F0"/&gt; &lt;/LinearLayout&gt; </code></pre> <p>fragment_xml:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"&gt; &lt;LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:gravity="center"&gt; &lt;Button android:id="@+id/playButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingTop="10dp" android:text="@string/play" style="@style/TextFont"/&gt; &lt;Button android:id="@+id/rankButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/rank" style="@style/TextFont"/&gt; &lt;Button android:id="@+id/achievementsButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/achievements" style="@style/TextFont" /&gt; &lt;Button android:id="@+id/settingsButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/settings" style="@style/TextFont"/&gt; &lt;com.google.android.gms.common.SignInButton android:id="@+id/sign_in_button" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;Button android:id="@+id/sign_out_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:textColor="@android:color/black" android:background="@android:drawable/btn_default" android:text="@string/logout" android:visibility="gone" /&gt; &lt;/LinearLayout&gt; &lt;/ScrollView&gt; </code></pre> <p>At the Fragment class, I inflate the view calling:</p> <pre><code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.menu_initial, container, false); ... </code></pre> <p>At the Activity class, I call the fragment with:</p> <pre><code>fm = getSupportFragmentManager(); if(fm.getBackStackEntryCount() == 0){ initialMenu = new InitialMenu(); fm.beginTransaction().replace(R.id.fragmentPlaceholder, initialMenu, "initialFrag").commit(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload