2016-01-08 2 views
0

Я начинаю развиваться в Android, и мне было интересно, есть ли другой способ изменить шрифт текста.I/Хореограф: пропущено 38 кадров

public class MainActivity extends AppCompatActivity { 


    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.escena_1/* .activity_main*/); 


/* IM USING THIS */ 
     TextView tx = (TextView) findViewById(R.id.textViewx); 
     Typeface custom_font = Typeface.createFromAsset(getAssets(), "font/OpenSans-Light.ttf"); 
     tx.setTypeface(custom_font); 



    } 
} 

Ну, у меня нет ничего кроме этого. Но я получаю сообщение об ошибке «Пропущено 38 кадров».

+0

ли вы имеете в виду с XML напрямую ? – wnieves19

+0

из любопытства, это устройство samsung? – petey

+0

Насколько я знаю, это не ошибка и может возникнуть при запуске любого приложения. Это просто приложение, запускаемое при высокой загрузке процессора (вызванное установкой через ADB, диспетчер пакетов и т. Д.) И пропускание некоторых кадров анимации. –

ответ

0

благодарит за ответы.

Это мой mainactivity.java

package com.example.asus.app1; 
 

 
    import android.graphics.Typeface; 
 
    import android.net.Uri; 
 
    import android.support.v7.app.AppCompatActivity; 
 
    import android.os.Bundle; 
 
    import android.widget.TextView; 
 
    
 
    import com.google.android.gms.appindexing.Action; 
 
    import com.google.android.gms.appindexing.AppIndex; 
 
    import com.google.android.gms.common.api.GoogleApiClient; 
 

 
    public class MainActivity extends AppCompatActivity { 
 
    
 
    private GoogleApiClient client; 
 

 
    @Override 
 
    protected void onCreate(Bundle savedInstanceState) { 
 
     super.onCreate(savedInstanceState); 
 
     setContentView(R.layout.escena_1/* .activity_main*/); 
 

 

 
     TextView tx = (TextView) findViewById(R.id.textViewx); 
 
     Typeface custom_font = Typeface.createFromAsset(getAssets(), "font/OpenSans-Light.ttf"); 
 
     tx.setTypeface(custom_font); 
 

 
     TextView texto_2 = (TextView) findViewById(R.id.textView2); 
 
     texto_2.setTypeface(custom_font); 
 

 

 
     // ATTENTION: This was auto-generated to implement the App Indexing API. 
 
     // See https://g.co/AppIndexing/AndroidStudio for more information. 
 
     /// client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build(); 
 
    } 
 

 

 
    }

И это Mya "escena_1" XML

<?xml version="1.0" encoding="utf-8"?> 
 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
 
    android:orientation="vertical" android:layout_width="match_parent" 
 
    android:layout_height="match_parent" 
 
    style="@android:style/Theme.Material.Light.Dialog.NoActionBar"> 
 

 
    <ImageView 
 
     android:layout_width="130dp" 
 
     android:layout_height="130dp" 
 
     android:id="@+id/imageView" 
 
     android:layout_gravity="center" 
 
     android:src="@drawable/image_1" 
 
     android:contentDescription="@string/imagen_1" 
 
     android:focusable="true" 
 
     android:cropToPadding="false" 
 
     android:layout_alignParentTop="true" 
 
     android:layout_centerHorizontal="true" 
 
     android:layout_marginTop="83dp" /> 
 
<!--StayWithMe12!--> 
 
    <TextView 
 
     android:layout_width="206dp" 
 
     android:layout_height="wrap_content" 
 
     android:textAppearance="?android:attr/textAppearanceMedium" 
 
     android:text="@string/text_1" 
 
     android:id="@+id/textViewx" 
 
     android:layout_gravity="center_horizontal|bottom" 
 
     android:gravity="top" 
 
     android:textIsSelectable="false" 
 
     android:textSize="33sp" 
 
     android:layout_centerVertical="true" 
 
     android:layout_centerHorizontal="true" /> 
 

 
    <TextView 
 
     android:layout_width="wrap_content" 
 
     android:layout_height="wrap_content" 
 
     android:textAppearance="?android:attr/textAppearanceLarge" 
 
     android:text="@string/text_2" 
 
     android:id="@+id/textView2" 
 
     android:textSize="15sp" 
 
     android:textIsSelectable="false" 
 
     android:textAlignment="center" 
 
     android:textColor="#666666" 
 
     android:layout_below="@+id/textViewx" 
 
     android:layout_alignParentStart="true" 
 
     android:layout_marginTop="27dp" /> 
 

 
</RelativeLayout>`enter code here`

Смежные вопросы