Answer the question
In order to leave comments, you need to log in
Fragment content indent from Action Bar and Tab controls when using Support Library?
Hey!
I am following the path indicated in the Guides of the official documentation, but I came across one unpleasant problem:
I generally understand what this is connected with - the absolute positioning of the menu, but how to fix it broke my head.
Using android:paddingTop="?attr/actionBarSize" in the fragment layout only helps if the Action Bar and Tabs are on the same line (landscape mode on my Desire HD), in portrait mode the tabs are broken.
In all examples, be it not okay, the content is centered around the entire layout and there is no such problem (three lines of text, after all).
Ask for help from more experienced colleagues.
Manifesto:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.me.pl"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="18"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application android:label="@string/app_name" android:icon="@drawable/ic_launcher" android:allowBackup="true" android:hardwareAccelerated="true">
<activity android:name=".MainActivity" android:label="@string/app_name" android:theme="@style/Theme.AppCompat.Light.DarkActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
</LinearLayout>
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:player="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_prefs"
android:icon="@drawable/ic_drawer"
android:title="@string/action_preferences"
player:showAsAction="always"/>
</menu>
Layout из фрагмента с багом:
<source lang="xml">
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>
<ListView
android:id="@+id/audioListView"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</ListView>
</LinearLayout>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question