이 이미지에서 프로그래밍 방식으로 텍스트를 설정하고 싶습니다.이 이미지에서 프로그래밍 방식으로 TextView를 설정하는 방법은 무엇입니까?
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
setContentView(R.layout.inbox);
}
이 이미지에서 프로그래밍 방식으로 텍스트를 설정하고 싶습니다.이 이미지에서 프로그래밍 방식으로 TextView를 설정하는 방법은 무엇입니까?
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
setContentView(R.layout.inbox);
}
이 게시물을 참조하십시오 : 날이 가로 화면 텍스트 뷰 얻을 도와주세요 https://stackoverflow.com/a/7855852/413127
'수직 텍스트 것은'당신이
public class VerticalTextView extends TextView{
final boolean topDown;
public VerticalTextView(Context context, AttributeSet attrs){
super(context, attrs);
final int gravity = getGravity();
if(Gravity.isVertical(gravity) && (gravity&Gravity.VERTICAL_GRAVITY_MASK) == Gravity.BOTTOM) {
setGravity((gravity&Gravity.HORIZONTAL_GRAVITY_MASK) | Gravity.TOP);
topDown = false;
}else
topDown = true;
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec){
super.onMeasure(heightMeasureSpec, widthMeasureSpec);
setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth());
}
@Override
protected boolean setFrame(int l, int t, int r, int b){
return super.setFrame(l, t, l+(b-t), t+(r-l));
}
@Override
public void draw(Canvas canvas){
if(topDown){
canvas.translate(getHeight(), 0);
canvas.rotate(90);
}else {
canvas.translate(0, getWidth());
canvas.rotate(-90);
}
canvas.clipRect(0, 0, getWidth(), getHeight(), android.graphics.Region.Op.REPLACE);
super.draw(canvas);
}
}
패키지를 XML 선언에 추가 할 필요가 없습니다.
그래, 나는 그 작업 thaks을 했어. 이제 글꼴을위한 ttf 파일을 가지고 어떻게이 텍스트의 타이프 페이스를 설정할 수 있습니까? –
[촬영을 위해 Google에 원하는 것입니다 이것 좀 봐.] (http://www.pocketmagic.net/?p=1625) – adneal