Sponsored By
















728x90

삼성디스플레이 기흥사업장

>


728x90

'ETC > 회사' 카테고리의 다른 글

연합뉴스  (0) 2019.11.06
미래에셋 센터원 빌딩  (0) 2019.11.06
SKT 타워  (0) 2019.11.01
넥센 더 유니버시티  (0) 2019.11.01
현대자동차 본사  (0) 2019.06.15
728x90

검은 글씨의 흰색 외곽선을 만들어 볼 것이다.

 

 

00. 먼저, TextView를 상속받아서 OutlineTextView 클래스를 만들자.







01. round.xml 파일을 만들고 아래 내용을 기입하자.







02. 사용할 레이아웃에다 방금 만든 OutlineTextview 클래스를 적용해보자.(clickable = "true" 를 해줘야 클릭 가능.)







03. 적용된 화면.

 

 

 

 

 

***** OutlineTextView Class

 

package com.astar.smin.ssbw;

 

import android.content.Context;

import android.content.res.ColorStateList;

import android.content.res.TypedArray;

import android.graphics.Canvas;

import android.graphics.Paint.Style;

import android.util.AttributeSet;

import android.widget.TextView;

 

public class OutlineTextView extends TextView {

 

    private boolean stroke = false;

    private float strokeWidth = 0.0f;

    private int strokeColor;

 

    public OutlineTextView(Context context, AttributeSet attrs, int defStyle) {

        super(context, attrs, defStyle);

 

        initView(context, attrs);

    }

 

    public OutlineTextView(Context context, AttributeSet attrs) {

        super(context, attrs);

 

        initView(context, attrs);

    }

 

    public OutlineTextView(Context context) {

        super(context);

    }

 

    private void initView(Context context, AttributeSet attrs) {

        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.OutlineTextView);

        stroke = a.getBoolean(R.styleable.OutlineTextView_textStroke, false);

        strokeWidth = a.getFloat(R.styleable.OutlineTextView_textStrokeWidth, 0.0f);

        strokeColor = a.getColor(R.styleable.OutlineTextView_textStrokeColor, 0xffffffff);

    }

 

 

    @Override

    protected void onDraw(Canvas canvas) {

 

        if (stroke) {

            ColorStateList states = getTextColors();

            getPaint().setStyle(Style.STROKE);

            getPaint().setStrokeWidth(strokeWidth);

            setTextColor(strokeColor);

            super.onDraw(canvas);

 

            getPaint().setStyle(Style.FILL);

            setTextColor(states);

        }

 

        super.onDraw(canvas);

    }

 

    @Override

    public boolean callOnClick() {

        return super.callOnClick();

    }

}

 

 

 

 

**** round.xml

 

<?xml version="1.0" encoding="utf-8"?>

<resources>

    <declare-styleable name="OutlineTextView">

        <attr format="boolean" name="textStroke"/>

        <attr format="float" name="textStrokeWidth"/>

        <attr format="color" name="textStrokeColor"/>

    </declare-styleable>

</resources>

 

 

 

 

 

728x90
728x90

현대자동차 지하 구내식당 점심
.


728x90

'ETC > 먹방' 카테고리의 다른 글

2019. 08. 01. 목. 저녁.  (0) 2019.08.02
2019. 07. 31. 수. 저녁.  (0) 2019.07.31
2019. 07. 28. 일. 점심  (0) 2019.07.28
2019. 07. 03. 수. 저녁.  (0) 2019.07.04
2019. 06. 04. 화. 점심  (0) 2019.06.04
728x90

ㅁ. 액션바 없애는 방법이다.

 

manifests 에 가서 thema를 아래와같이 NoActionBar 로 설정해주면 된다.

 

android:theme="@style/Theme.AppCompat.NoActionBar"

 

 

 

 

 

 

 

 

 

728x90
728x90

설명이 잘되있어서 따로 설명은 달지않겠습니다.

 

 

출처 및 방법 주소입니다. :

 

https://github.com/PhilJay/MPAndroidChart

 

 

 

 

 

 

 

 

728x90


Sponsored By















+ Recent posts