2017-11-23 16 views
0
에 값하는 경우 미리 카드를 사용하는 방법

내 봇은 다음과 FormBuilder 있습니다정의하는 동적 FormBuilder

public static IForm<BasicForm> BuildForm() 
    { 
     return new FormBuilder<BasicForm>() 
      .Field(new FieldReflector<BasicForm>(nameof(Os)) 
        .SetType(null) 
        .SetPrompt(new PromptAttribute("Please tell me the {&} {||}")) 
        .SetDefine(async (state, field) => 
        { 
         List<string> list = new List<string> { "ANDROID" , "IOS" }; 
         foreach (string item in list) 
         { 
          switch (item) 
          { 
           case "ANDROID": 
            field 
             .AddDescription(item, item, image: "<android-logo.jpg>") 
             .AddTerms(item, item); 
            break; 
           case "IOS": 
            field 
             .AddDescription(item, item, image: "<ios-logo.jpg>") 
             .AddTerms(item, item); 
            break; 
          } 
         } 
         return true; 
        })) 
      .AddRemainingFields() 
      .OnCompletion(async (context, state) => 
      { 
       await context.PostAsync("Your request has been submitted. I am tracking your link. I will send you the result as soon as possible"); 
      }) 
      .Build(); 
    } 

이 코드는 ScreenShot from bot-framwork emulator

문제는 HeroCard 이미지를 늘릴 것이다 다음 HeroCard 생산을 : 이미지의 원래 크기는 200x200입니다. FormBuilder에서 HeroCard 이미지의 폭과 높이를 정의 할 수있는 방법이 있습니까?

그렇지 않으면 HeroCard 대신 ThumbnailCard를 사용할 수 있습니까?

감사합니다.

답변

1

FormBuilder의 HeroCard 이미지에서 너비와 높이를 정의하는 방법이 있습니까?

아니요, 지금은 코드의 크기를 수정하는 방법이 없습니다. 카드의 이미지 크기는 채널마다 다릅니다. 자세한 내용은 Image not get fit inside herocard,Thumbnail card.의 토론을 참조하십시오.

그렇지 않으면 HeroCard 대신 ThumbnailCard를 사용할 수 있습니까?

예, 가능, 당신은 공식 Rich Cards Bot Sample 또는 Carousel of Cards Bot Sample받는 참조 할 수 있습니다. 하지만 썸네일 카드의 기본 템플릿이 있습니다. 이미지가 카드의 오른쪽 상단에 표시됩니다. 귀하의 시나리오에서는 필요하지 않습니다.

그래서 지금 우리가 할 수있는 일은 다양한 채널의 가로 세로 비율에 따라 다양한 크기의 이미지 리소스를 사용하는 것입니다.