기본 콘텐츠로 건너뛰기

[android] textview 옆에 image 추가하기.

최근 글

[ios] image set Retina 4-inch가 안먹을 때

Image set을 이용하여 기기별로 이미지를 각각 지정하여도 iphone5/5s에서 Retina 4-inch의 이미지가 적용이 되지 않고 2x의 이미지가 적용되는 현상이 발생했다. 적용되지 않았던 원인은!! Deployment Target을 6.0으로 지정했기 때문에!!! 7.0으로 변경하니 제대로 적용되었다. 7.0부터 적용되며 그 이하에서는 Retina 4-inch대신 2x이미지가 적용되는듯 하다.

[ios] addsubview를 사용해 autolayout이 작동하지 않을 때

autolayout을 적용했음에도 view의 크기가 기기에 따라 변하지 않을 때 (fullscreen을 원할 때) FirstViewController *viewController = [[ FirstViewController  alloc ]  initWithNibName : @"FirstViewController" bundle : nil ]; viewController. view . frame = self . view . frame ; or  viewController. view . frame  =[ UIScreen   mainScreen ]. applicationFrame ; [ self . view addSubview : viewController. view ];

[ios] viewcontroller 간의 데이터(값) 전달 (delegate 이용)

FirstViewController SecondViewController 두개의 뷰가 존재하며 FirstViewController에 SecondViewController의 데이터를 전달하고자 한다. SecondViewController : 데이터를 전달 FirstViewController : 데이터를 받음 [SecondViewController.h] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 // 프로토콜 선언 @protocol SecondViewDelegate  < NSObject > ; @required - ( void ) getData:( int )data; @end // 델리게이트 선언 @ interface  SecondViewController : UIViewController {     id  <  SecondViewDelegate  >  delegate; } @property (nonatomic,assign) id <  SecondViewDelegate  >  delegate; @end Colored by Color Scripter cs [SecondViewController.m] 1 2 // 값을 보냄 [self.delegate getSelectData: 10 ]; cs [FirstViewController.h] 1 2 3 4 # import   "SecondViewController.h" @ interface  F...

[android] listview 구현하기

<main.xml> android:divider -> 리스트의 셀사이의 선색 android:dividerHeight -> 리스트의 셀사이 선 두께 1 2 3 4 5 6 7 <ListView      android:id="@+id/list"      android:layout_width="fill_parent"      android:layout_height="wrap_content"      android:divider="#ff0000"      android:dividerHeight="1dp" > </ListView> cs <MainActivity.java> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 ArrayList<String> m_arr;          @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentV...

[android] login dialog popup 구현 / Activity를 dialog로 만들기 / custom dialog

login dialog (custom dialog) 만들기 Activity를 dialog로 보이기. Manifest에서 android:theme="@android:style/Theme.Holo.Light.Dialog" 1 2 < activity android:name = ".ActivityDialog"     android:theme = "@android:style/Theme.Holo.Light.Dialog" > < / activity > cs login dialog 만드는 자세한 소스는 추후 추가.

[android] 이클립스 줄 넘버, 줄 번호 (eclipse line number)

사진과 같이 eclipse에서 왼쪽 줄번호 나타내는 방법. Window > Preferences > General > Editors > Text Editors > Show line numbers 체크