'2017/01/30'에 해당되는 글 2건

  1. 2017.01.30 Android.editText 하단라인 보이기.안보이게 하기
  2. 2017.01.30 Android.Activity Title bar 제거

[ Android.editText 하단라인 보이기.안보이게 하기 ]

 

1. 정의

    - EditText의 기본은 전체 4각형 Box에 하단 라인이 기본적으로 보이게 된다.

    - focus가 위치하는 EditText의 하단라인은 핑크색

    - focus를 잃었은 EditText의 하단라인은 진한회색

 

2. 하단라인 없애기

    - [ android:background="??" ] 속성을 기술하면 하단라인이 보이지 않는다.

    - [ android:background="??" ] 속성을 기술하지 않으면 하단라인이 보인다.

 

3. 화면

    - 왼쪽     화면은 하단 라인이 보이기

       . background 속성을 기술하지 않았음.

       . focus가 위치하는 EditText의 하단라인은 핑크색

       . focus를 잃었은 EditText의 하단라인은 진한회색

    - 오른쪽 화면은 하단 라인 안보이게 하기

       . 아이디 입력 EditText는  [ android:background="@null" ] 으로 처리

       . 비밀번호 입력 EditText는  [ android:background="#d7d5d7" ](회색) 으로 처리

      

   

 

 

 

 

'[Android] - 위젯 > EditText' 카테고리의 다른 글

키보드 보이게 하기  (0) 2017.01.02
Focus 막기. Editting 안되게 하기  (0) 2017.01.02
포커스 주기  (0) 2017.01.02
숫자 관련  (0) 2017.01.01
Posted by 농부지기
,

[ Android.Activity Title bar 제거 ]

 

1. 정의

    - Android App의 Title bar제거

 

2. Title bar 화면

    - 왼쪽     화면은 Title bar가 존재

    - 오른쪽 화면은 Title bar가 제거된 상태

   

 

3. Title bar 제거 방법 1

    - 기본 Activity에

       supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
      이 문장을 삽입한다.

      반드시 setContentView()보다 먼저 기술해야 됨

 

public class UserActivity extends AppCompatActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        supportRequestWindowFeature(Window.FEATURE_NO_TITLE);

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user);
    }
}

 

  - java단에서  'Activity'를 상속받은 경우에는 다음을 사용

    requestWindowFeature(Window.FEATURE_NO_TITLE);

 

   - java단에서  'AppCompatActivity'를 상속받은 경우에는 다음을 사용

     supportRequestWindowFeature(Window.FEATURE_NO_TITLE);

 

4. Title bar 제거 방법 2

     1. Menifest 파일에 다음 tag 등록

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


     2. Application 전체에서 제거하려면

 

 <application
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:allowBackup="true"
    android:supportsRtl="true"
    android:theme="@style/Theme.AppCompat.NoActionBar">
    <activity
        android:name=".user.UserActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

 

     3. Activity element만 제거하려면

 

<application
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:allowBackup="true"
    android:supportsRtl="true">
    <activity
        android:theme="@style/Theme.AppCompat.NoActionBar"
        android:name=".user.UserActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

 

Posted by 농부지기
,