بروز خطا
[message]
اشتراک در سوال
رای ها
[dataList]
سفارشی کردن و تغییر اکشن بار ، فونت و رنگ و متن و آیکن و طرح
اکشن بار
< ?xml version="1.0" encoding="utf-8"? >
< LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/actionBar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:paddingLeft="5dp"
android:paddingTop="7dp"
android:orientation="horizontal" >
< TextView
android:id="@+id/titleFragment1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Syntax"
android:textSize="20sp"
android:textColor="@color/selected" / >
< TextView
android:id="@+id/titleFragment2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:text="ionary" / >
< / LinearLayout>
برای این سوال 3 پاسخ وجود دارد.
پاسخ به سوال
aliakbar333
11 سال پیش
+1
0
همچنین
private void createCutomActionBarTitle(){
this.getActionBar().setDisplayShowCustomEnabled(true);
this.getActionBar().setDisplayShowTitleEnabled(false);
LayoutInflater inflator = LayoutInflater.from(this);
View v = inflator.inflate(R.layout.custom_action_bar, null);
Typeface tf = Typeface.createFromAsset(getAssets(),"font/yourfont.ttf");
((TextView)v.findViewById(R.id.titleFragment1)).setTypeface(tf);
((TextView)v.findViewById(R.id.titleFragment2)).setTypeface(tf);
//assign the view to the actionbar
this.getActionBar().setCustomView(v);
}
من زمانی که که setcustomview میکنم و گوشی رو در حالت افقی قرار میدم متن تبم ناپدید میشه و میره توی منو به نظر شما مشکل از کجاست؟ مانند این لینک (11 سال پیش)
پاسخ به سوال
aliakbar333
11 سال پیش
0
0
اضافه نمودن رفتارها
private void createCutomActionBarTitle(){
this.getActionBar().setDisplayShowCustomEnabled(true);
this.getActionBar().setDisplayShowTitleEnabled(false);
LayoutInflater inflator = LayoutInflater.from(this);
View v = inflator.inflate(R.layout.action_bar_contribution, null);
Typeface tf = Typeface.createFromAsset(getAssets(),"font/fat_tats.ttf");
TextView frag1 = (TextView)v.findViewById(R.id.titleFragment1);
frag1.setTypeface(tf);
TextView frag2 = (TextView)v.findViewById(R.id.titleFragment2);
frag2.setTypeface(tf);
frag1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(YourCurrentActivity.this, YourTargetActivity.class));
finish();
}
});
frag2.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(YourCurrentActivity.this, YourTargetActivity.class));
finish();
}
});
//assign the view to the actionbar
this.getActionBar().setCustomView(v);
}
پاسخ به سوال
aliakbar333
11 سال پیش
0
0
اضافه نمودن متا دیتا به منیفیست
< activity android:label="yourActivityLabelName"
android:name="your.package.YourActivity"
android:parentactivityname="your.package.YourTargetActivity"
android:screenorientation="landscape"
android:windowsoftinputmode="stateHidden" >
< meta-data android:name="android.support.PARENT_ACTIVITY"
android:value="your.package.YourTargetActivity" >
< / meta-data>
< / activity>
پاسخگویی و مشاهده پاسخ های این سوال تنها برای اعضای ویژه سایت امکان پذیر است .
چنانچه تمایل دارید به همه بخش ها دسترسی داشته باشید میتوانید از این بخش لایسنس این آموزش را خریداری نمایید .