انجمن سایت کلیدستان


رتبه موضوع:
  • 0 رای - 0 میانگین
  • 1
  • 2
  • 3
  • 4
  • 5
مشکل در تغییر فونت برنامه اندروید

مشکل در تغییر فونت برنامه اندروید

#3
یه اکتیوتی ساده ست 

کد پی‌اچ‌پی:
package com.example.fortest;

import com.develox.iliya.R;

import android.app.Activity;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;

public class 
MainActivity extends Activity {

    @
Override
    
protected void onCreate(Bundle savedInstanceState) {
        
super.onCreate(savedInstanceState);
        
setContentView(R.layout.activity_main);
    }
    
    
TextView tv = (TextViewfindViewById(R.id.textView1);
    
Typeface tf Typeface.createFromAsset(getAssets(),"fonts/dast_nevis.ttf"); 
    
tv.setTypeface(tf);

    @
Override
    
public boolean onCreateOptionsMenu(Menu menu) {
        
// Inflate the menu; this adds items to the action bar if it is present.
        
getMenuInflater().inflate(R.menu.mainmenu);
        return 
true;
    }

    @
Override
    
public boolean onOptionsItemSelected(MenuItem item) {
        
// Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        
int id item.getItemId();
        if (
id == R.id.action_settings) {
            return 
true;
        }
        return 
super.onOptionsItemSelected(item);
    }

پاسخ


پیام‌های این موضوع
RE: مشکل در تغییر فونت برنامه اندروید - توسط admin - ۱۳۹۴/۰۴/۱۰, ۰۳:۰۹ ق.ظ
RE: مشکل در تغییر فونت برنامه اندروید - توسط دیب دمینی - ۱۳۹۴/۰۴/۱۰, ۰۶:۴۸ ب.ظ
RE: مشکل در تغییر فونت برنامه اندروید - توسط admin - ۱۳۹۴/۰۴/۱۱, ۰۲:۵۱ ق.ظ

پرش به انجمن:


کاربران در حال بازدید این موضوع: 1 مهمان