مدیریت کاربران مشترک
بروز خطا
امتیازات دریافتی
حساب
آموزش هوش مصنوعی برای برنامه نویسان
وبینار ها
چرا با هزار مدل ترفند تولبار را راستچین کنیم وقتی میتوانیم تولبار شخصی بسازیم ؟
یک فایل xml. تولبار ایجاد کرده و طراحی میکنیم
و در نهایت آنرا در هر لیوتی که خواستیم include میکنیم
<include layout="@layout/toolbar"/>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="72dp"
android:paddingRight="8dp"
android:text="@string/app_name_fa"
android:textColor="@color/textColorPrimary"
android:textSize="18sp"/>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
</LinearLayout>