7월, 2016의 게시물 표시

Xml Gradient Drawable중 type="radial"문제.

원형 그라데이션을 xml로 추가하기 위해서, 아래와 같은 형식의 xml을 작성해 사용해보려 하였다. (출처 : http://www.b2creativedesigns.com/shapes.php) bg_simple.xml: 1 <?xml version= "1.0"   encoding= "UTF-8" ?> 2 <shape xmlns:android= " http://schemas.android.com/apk/res/android " 3      android:shape= "rectangle" > 4      <gradient android:type= "radial" 5           android:startColor= "#39629C" 6           android:centerColor= "#5580BD" 7           android:endColor= "#C8DAF2" 8           android:gradientRadius= "350" /> 9 </shape> 하지만, 계속해서 화면에 보이는것은 단색. 이리저리 값들을 바꿔보았지만, gradientRadius 값이 0.5를 경계로 startColor/endColor 기준으로 단색이 나오는 것을 빼고는 변하는 것이 없었다.  Android Relese Note에서 확인해보니 아래와 같은 issue가 등록되었고, (https://code.google.com/p/android/issues/detail?id=71065) Android 5.0 (Lollipop)에서 발생하던 이슈였고, 5.1에서 수정될 것이라고 한다. [이런... 그렇다면 radial Type의 xml은 사용못하는

[펌] RelativeLayout의 alignBaseline과 alignBottom의 차이

이미지
RelativeLayout의 alignBaseline과 alignBottom의 차이가 궁금해서 검색하다가 유용한 정보를 확인하게 되어 모아둔다. 아래와 같은 고민을 했던 적이 있는데, 이런식으로 정렬이 가능하단걸 알게 되었으니, 앞으로 참 잘 쓸 수 있을 듯 하다. To visualize the difference, I usually imagine two textboxes in Word or Photoshop. alignBottom  lines up the bottom of the textboxes. (The blue outline) Text could be uneven, but the boxes they're in would line up on the bottom. alignBaseline  aligns the actual text within the box. This can help ensure that the texts line up on the bottom, regardless of font size or textbox size. (The green line) What is a Baseline? Baseline  is a typography term that refers to the invisible line text is written on. (As referenced in  What is the baseline in RelativeLayout? ) Warning If you're not careful, using alignBaseline could make your layout look like this:  Details:  Watch That Baseline Alignment I don't know if you're still looking for the answer, but I decided to at least put this out there

AndroidMenifest에서 Http URL intent filter 걸기

이미지
웹서비스와 앱서비스를 동시에 하는 유튜브와 같은 경우는 앱에서 해당 URL을 잡아서 앱으로 바로 띄울수도 있는 기능이 필요하다. 물론 앱을 띄우기 위해서 appScheme://execute 와 비슷한 scheme을 사용할 수 도 있지만, 해당 Scheme은 앱이 설치 되어있지 않은 단말에서는 무용지물이기 때문에 그것에 대비한 방법으로 아래 내용을 소개한다. 1. 목적    - http 혹은 https URL의 링크 이동을 앱에서 직접 잡아서  앱을 띄울 수 있도록 처리한다. 2. 기본방법    ※ 예시)  http://www.myservice.com/ 이라는 URL로 이동시 앱을 띄우고자 할 때    Step 1) AndroidMenifest.xml에서 해당 URL로 앱이 실행 될 경우 띄울 Activity에 아래와 같은 내용을 추가한다. 1 2 3 4 5 6 7 < intent-filter >     < action   android:name = "android.intent.action.VIEW"   / >     < category   android:name = "android.intent.category.DEFAULT"   / >     < category   android:name = "android.intent.category.BROWSABLE"   / >         < data   android:scheme = "http"                    android:host = "www.myservice.com" / > </ intent-filter > Colored by Color Scripter cs      Step 2) 해당 Activity의 Java C