2016-07-05 2 views
0

UrbanAirship 사이트 (구성 -> 인앱 메시지)에 구성 섹션이 있고 http://docs.urbanairship.com/platform/android.html#custom-style을 읽었 음을 이미 알고 있습니다. 그러나 이것으로 모든 인앱 레이아웃을 변경할 수는 없습니다. 합계에서Urbanairship - 인앱 메시지 맞춤

:

나는 (... 텍스트 버튼 만 버튼 배경 색상, 색상을 변경, 적용 국경) 버튼을의 스타일을 변경할 수있는 방법
  1. ?

    Base.Widget.UrbanAirship.InAppMessage.Banner.ActionButton I 버튼 및 알림 설명 사이의 구분선을 숨길 수있는 방법

  2. ?

    Base.Widget.UrbanAirship.InAppMessage.Banner.Divider

답변

2

레이아웃 조정은 조금 더 많은 일을하지만, 할 수 있습니다.

public class CustomInAppMessageFragment extends InAppMessageFragment { 
    @Override 
    public View onCreateView(LayoutInflater inflater, final ViewGroup container, Bundle savedInstanceState) { 
     if (getMessage() == null || getMessage().getAlert() == null) { 
      dismiss(false); 
      return null; 
     } 


     // Bind the in-app message to the layout. The fragment is attached to the content of the activity, 
     // so it has the full activity width and height to work with. 
     TextView view = (TextView) inflater.inflate(android.R.layout.simple_list_item_1, container, false); 
     view.setText(getMessage().getAlert()); 


     return view; 
    } 
} 

그런 다음 이륙 후 인 - 응용 프로그램 메시지 관리자의 조각 공장 설정 :

airship.getInAppMessageManager().setFragmentFactory(new InAppMessageFragmentFactory() { 
    @Override 
    public InAppMessageFragment createFragment(InAppMessage message) { 
     return new CustomInAppMessageFragment(); 
    } 
}); 

는 방법에를 볼 수 source에서 봐 먼저 사용자 정의 InAppMessageFragment을 만들어야합니다 -app 메시지 조각의보기가 정상적으로 작성됩니다.