검색결과 리스트
안드로이드에 해당되는 글 30건
- 2013.03.27 Button drawableLeft 자바에서 설정하기
- 2013.03.26 view getId() string 문자 알아보기(EntryName)
- 2013.02.22 GridView stretchMode
- 2013.01.25 shape 레이아웃 모서리 둥글게 하기
- 2013.01.25 배경 이미지 repeat 시키기
글
Button drawableLeft 자바에서 설정하기
Drawable img = getContext().getResources().getDrawable( R.drawable.smiley );
img.setBounds( 0, 0, 60, 60 );
txtVw.setCompoundDrawables( img, null, null, null );
or
Drawable img = getContext().getResources().getDrawable( R.drawable.smiley );
txtVw.setCompoundDrawablesWithIntrinsicBounds( img, null, null, null );
// 아이콘 정렬
setCompoundDrawablesWithIntrinsicBounds( 왼쪽, 위, 오른쪽, 아래 );
'안드로이드 > android' 카테고리의 다른 글
위젯 사이즈 (0) | 2013.04.16 |
---|---|
webview 클립보드 (Copy & paste) 에 내용 넣기 (0) | 2013.04.05 |
view getId() string 문자 알아보기(EntryName) (0) | 2013.03.26 |
GridView stretchMode (0) | 2013.02.22 |
shape 레이아웃 모서리 둥글게 하기 (0) | 2013.01.25 |
설정
트랙백
댓글
글
view getId() string 문자 알아보기(EntryName)
View.OnClickListener clickListener = new View.OnClickListener() {
// TODO clickListener
public void onClick(final View v) {
switch (v.getId()) {
case R.id.photo1:
case R.id.photo2:
case R.id.photo3:
Log.i("ID값",v.getResources().getResourceEntryName(v.getId()));
// 결과 photo1, photo2, photo3
break;
}
}
};
'안드로이드 > android' 카테고리의 다른 글
webview 클립보드 (Copy & paste) 에 내용 넣기 (0) | 2013.04.05 |
---|---|
Button drawableLeft 자바에서 설정하기 (0) | 2013.03.27 |
GridView stretchMode (0) | 2013.02.22 |
shape 레이아웃 모서리 둥글게 하기 (0) | 2013.01.25 |
배경 이미지 repeat 시키기 (0) | 2013.01.25 |
설정
트랙백
댓글
글
GridView stretchMode
android:stretchMode android:numColumns="auto_fit" 으로 지정한 경우 열의 나머지 공간 처리 지정
- android:stretchMode="columnWidth" : 위젯이 격자 내부를 가득채우게 함
- android:stretchMode="spacingWidth" : 남는공간을 여백으로 채움
'안드로이드 > android' 카테고리의 다른 글
Button drawableLeft 자바에서 설정하기 (0) | 2013.03.27 |
---|---|
view getId() string 문자 알아보기(EntryName) (0) | 2013.03.26 |
shape 레이아웃 모서리 둥글게 하기 (0) | 2013.01.25 |
배경 이미지 repeat 시키기 (0) | 2013.01.25 |
통화이력 목록으로 뽑아내기 (0) | 2013.01.23 |
설정
트랙백
댓글
글
shape 레이아웃 모서리 둥글게 하기
// res/drawable/shape.xml
============================================================================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#90000000"/>
<stroke android:width="4dp" android:color="#50000000"
android:dashWidth="1dp" android:dashGap="0dp" />
<padding android:left="7dp" android:top="7dp"
android:right="7dp" android:bottom="7dp" />
<corners android:radius="10dp" />
</shape>
<TextView
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:textSize="16sp" android:textStyle="bold" android:text="모서리 둥글게 하자" android:textColor="#ffffff"
android:gravity="center" android:background="@drawable/shape"
android:padding="16px"
/>
'안드로이드 > android' 카테고리의 다른 글
view getId() string 문자 알아보기(EntryName) (0) | 2013.03.26 |
---|---|
GridView stretchMode (0) | 2013.02.22 |
배경 이미지 repeat 시키기 (0) | 2013.01.25 |
통화이력 목록으로 뽑아내기 (0) | 2013.01.23 |
특정 전화 번호로 주소록에 등록 되어 있는지 체크하기 (0) | 2013.01.09 |
설정
트랙백
댓글
글
배경 이미지 repeat 시키기
1x1 이미지를 배경으로 반복해서 보이게 하기
====================================================================
// res/drawble/background_image.xml
==================================================================
<?xml version="1.0" encoding="utf-8"?>
<bitmap
xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/background" android:tileMode="repeat"
/>
// res/layout/background.xml
<LinearLayout android:background="@drawable/background_image.xml" />
=======================================================================
// theme manifest
========================================================================
/res/values/theme.xml
<style name="Theme.BackGround" parent="android:Theme">
<item name="android:windowBackground">@drawable/background</item>
<item name="android:windowNoTitle">true</item>
</style>
/manifest.xml
<activity android:name=".Test" android:label="@string/app_name" android:screenOrientation="landscape"
android:theme="@style/Theme.BackGround" />
'안드로이드 > android' 카테고리의 다른 글
GridView stretchMode (0) | 2013.02.22 |
---|---|
shape 레이아웃 모서리 둥글게 하기 (0) | 2013.01.25 |
통화이력 목록으로 뽑아내기 (0) | 2013.01.23 |
특정 전화 번호로 주소록에 등록 되어 있는지 체크하기 (0) | 2013.01.09 |
Dialog Fullscreen theme (0) | 2013.01.04 |