レイアウトの調整は少しより多くの仕事を取ることなく、行うことができます。離陸後にアプリ内のメッセージマネージャのフラグメントの工場を設定すると
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メッセージフラグメントのビューは通常作成されます。